diff options
author | wfh <wfh@chromium.org> | 2015-04-08 20:47:13 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-09 03:48:42 +0000 |
commit | 8be51d2c404486d434bbd0496950024995661bb3 (patch) | |
tree | 24df085502a9f2fee90d42151be2b7c38f94d726 /sandbox | |
parent | be79f477e4d1e66e2d80e7bcd5f9689f3fbbcefc (diff) | |
download | chromium_src-8be51d2c404486d434bbd0496950024995661bb3.zip chromium_src-8be51d2c404486d434bbd0496950024995661bb3.tar.gz chromium_src-8be51d2c404486d434bbd0496950024995661bb3.tar.bz2 |
Fix scoped_ptr free to use delete [] instead of delete.
BUG=101717
Review URL: https://codereview.chromium.org/1066203003
Cr-Commit-Position: refs/heads/master@{#324355}
Diffstat (limited to 'sandbox')
-rw-r--r-- | sandbox/win/src/win_utils.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sandbox/win/src/win_utils.cc b/sandbox/win/src/win_utils.cc index d2b507d..2ff1b73 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. |