[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

@@ -7,6 +7,7 @@
#include <uv.h>
#include <cstdlib>
#include <functional>
#include <memory>
#include <utility>
@@ -288,7 +289,7 @@ class HandleImpl : public Handle {
}
protected:
HandleImpl() : Handle{reinterpret_cast<uv_handle_t*>(new U)} {}
HandleImpl() : Handle{static_cast<uv_handle_t*>(std::malloc(sizeof(U)))} {}
};
} // namespace wpi::uv