Index: sandbox/win/src/handle_closer.cc |
diff --git a/sandbox/win/src/handle_closer.cc b/sandbox/win/src/handle_closer.cc |
index a47bf6564cfc78ef9ecfb0d9fe0c96fdfe10d1d0..39915a9b0a1181cd1b45bbc38ff962a418b25d4d 100644 |
--- a/sandbox/win/src/handle_closer.cc |
+++ b/sandbox/win/src/handle_closer.cc |
@@ -180,11 +180,12 @@ bool GetHandleName(HANDLE handle, string16* handle_name) { |
ResolveNTFunctionPtr("NtQueryObject", &QueryObject); |
ULONG size = MAX_PATH; |
- scoped_ptr<UNICODE_STRING> name; |
+ scoped_ptr<UNICODE_STRING, base::FreeDeleter> name; |
NTSTATUS result; |
do { |
- name.reset(reinterpret_cast<UNICODE_STRING*>(new BYTE[size])); |
+ name.reset(static_cast<UNICODE_STRING*>(malloc(size))); |
+ DCHECK(name.get()); |
result = QueryObject(handle, ObjectNameInformation, name.get(), |
size, &size); |
} while (result == STATUS_INFO_LENGTH_MISMATCH || |