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

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

Issue 1066203003: Fix scoped_ptr free to use delete [] instead of delete. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/win/src/win_utils.cc
diff --git a/sandbox/win/src/win_utils.cc b/sandbox/win/src/win_utils.cc
index d2b507d3e6a848e79bb2016bf6541f5a18bb88bc..2ff1b7343c23d0222677625ff753357b0d86a378 100644
--- a/sandbox/win/src/win_utils.cc
+++ b/sandbox/win/src/win_utils.cc
@@ -355,13 +355,14 @@ bool GetPathFromHandle(HANDLE handle, base::string16* path) {
OBJECT_NAME_INFORMATION* name = &initial_buffer;
ULONG size = sizeof(initial_buffer);
// Query the name information a first time to get the size of the name.
+ // Windows XP requires that the size of the buffer passed in here be != 0.
NTSTATUS status = NtQueryObject(handle, ObjectNameInformation, name, size,
&size);
- scoped_ptr<OBJECT_NAME_INFORMATION> name_ptr;
+ scoped_ptr<BYTE[]> name_ptr;
if (size) {
- name = reinterpret_cast<OBJECT_NAME_INFORMATION*>(new BYTE[size]);
- name_ptr.reset(name);
+ name_ptr.reset(new BYTE[size]);
+ name = reinterpret_cast<OBJECT_NAME_INFORMATION*>(name_ptr.get());
// Query the name information a second time to get the name of the
// object referenced by the handle.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698