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

Unified Diff: sandbox/win/src/handle_table.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 | « sandbox/win/src/handle_closer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/win/src/handle_table.cc
diff --git a/sandbox/win/src/handle_table.cc b/sandbox/win/src/handle_table.cc
index a497f7489091b4a0cdd0edeaa6d68ded4a562033..7230dff87b568b4e5b650e60af89471686bca990 100644
--- a/sandbox/win/src/handle_table.cc
+++ b/sandbox/win/src/handle_table.cc
@@ -7,6 +7,7 @@
#include <algorithm>
#include <cstdlib>
+#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "sandbox/win/src/win_utils.h"
@@ -120,9 +121,10 @@ void HandleTable::HandleEntry::UpdateInfo(UpdateType flag) {
case UPDATE_INFO_AND_NAME:
if (type_info_buffer_.size() && handle_name_.empty()) {
ULONG size = MAX_PATH;
- scoped_ptr<UNICODE_STRING> name;
+ scoped_ptr<UNICODE_STRING, base::FreeDeleter> name;
do {
- name.reset(reinterpret_cast<UNICODE_STRING*>(new BYTE[size]));
+ name.reset(static_cast<UNICODE_STRING*>(malloc(size)));
+ DCHECK(name.get());
result = QueryObject(reinterpret_cast<HANDLE>(
handle_entry_->Handle), ObjectNameInformation, name.get(),
size, &size);
« no previous file with comments | « sandbox/win/src/handle_closer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698