Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1744)

Unified Diff: sandbox/win/src/handle_closer.cc

Issue 16404003: Fix new[]/delete mismatches in sandbox handle code by switching to scoped_ptr<C, base::FreeDeleter>. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sandbox/win/src/handle_table.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ||
« no previous file with comments | « no previous file | sandbox/win/src/handle_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698