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

Unified Diff: sandbox/src/acl.cc

Issue 9107029: Fix memory dealocatiom mismatch by using scoped_ptr_malloc (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 11 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/src/acl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/src/acl.cc
===================================================================
--- sandbox/src/acl.cc (revision 116953)
+++ sandbox/src/acl.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -12,7 +12,7 @@
namespace sandbox {
bool GetDefaultDacl(HANDLE token,
- scoped_ptr<TOKEN_DEFAULT_DACL>* default_dacl) {
+ scoped_ptr_malloc<TOKEN_DEFAULT_DACL>* default_dacl) {
if (token == NULL)
return false;
@@ -26,7 +26,7 @@
}
TOKEN_DEFAULT_DACL* acl =
- reinterpret_cast<TOKEN_DEFAULT_DACL*>(new char[length]);
+ reinterpret_cast<TOKEN_DEFAULT_DACL*>(malloc(length));
default_dacl->reset(acl);
if (!::GetTokenInformation(token, TokenDefaultDacl, default_dacl->get(),
@@ -59,7 +59,7 @@
if (token == NULL)
return false;
- scoped_ptr<TOKEN_DEFAULT_DACL> default_dacl;
+ scoped_ptr_malloc<TOKEN_DEFAULT_DACL> default_dacl;
if (!GetDefaultDacl(token, &default_dacl))
return false;
@@ -78,9 +78,9 @@
bool AddUserSidToDefaultDacl(HANDLE token, ACCESS_MASK access) {
DWORD size = sizeof(TOKEN_USER) + SECURITY_MAX_SID_SIZE;
- TOKEN_USER* token_user = reinterpret_cast<TOKEN_USER*>(new BYTE[size]);
+ TOKEN_USER* token_user = reinterpret_cast<TOKEN_USER*>(malloc(size));
- scoped_ptr<TOKEN_USER> token_user_ptr(token_user);
+ scoped_ptr_malloc<TOKEN_USER> token_user_ptr(token_user);
if (!::GetTokenInformation(token, TokenUser, token_user, size, &size))
return false;
« no previous file with comments | « sandbox/src/acl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698