[wpiutil] uv Handle: Use malloc/free instead of new/delete (#3325)

This avoids asan warnings for deleting a different pointer type.
This commit is contained in:
Peter Johnson
2021-05-01 07:04:14 -07:00
committed by GitHub
parent 365f5449ca
commit f99f62bee4
4 changed files with 9 additions and 5 deletions

View File

@@ -8,9 +8,9 @@ using namespace wpi::uv;
Handle::~Handle() noexcept {
if (!m_closed && m_uv_handle->type != UV_UNKNOWN_HANDLE) {
uv_close(m_uv_handle, [](uv_handle_t* uv_handle) { delete uv_handle; });
uv_close(m_uv_handle, [](uv_handle_t* uv_handle) { std::free(uv_handle); });
} else {
delete m_uv_handle;
std::free(m_uv_handle);
}
}