From 8c70345e6b806821d0a57fa1e92d38aaebd07406 Mon Sep 17 00:00:00 2001 From: "jschuh@chromium.org" Date: Thu, 15 Sep 2011 02:26:50 +0000 Subject: Prevent implicit local string from getting deleted. BUG=90259 TEST=None Review URL: http://codereview.chromium.org/7892024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101229 0039d316-1c4b-4281-b951-d872f2087c98 --- content/common/sandbox_policy.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/content/common/sandbox_policy.cc b/content/common/sandbox_policy.cc index ad48a2a..f42d7f6 100644 --- a/content/common/sandbox_policy.cc +++ b/content/common/sandbox_policy.cc @@ -239,10 +239,11 @@ string16 PrependWindowsSessionPath(const char16* object) { // Closes handles that are opened at process creation and initialization. void AddBaseHandleClosePolicy(sandbox::TargetPolicy* policy) { // Being able to manipulate anything BaseNamedObjects is bad. - policy->AddKernelObjectToClose(L"Directory", PrependWindowsSessionPath( - L"\\BaseNamedObjects").data()); - policy->AddKernelObjectToClose(L"Section", PrependWindowsSessionPath( - L"\\BaseNamedObjects\\windows_shell_global_counters").data()); + string16 object_path = PrependWindowsSessionPath(L"\\BaseNamedObjects"); + policy->AddKernelObjectToClose(L"Directory", object_path.data()); + object_path = PrependWindowsSessionPath( + L"\\BaseNamedObjects\\windows_shell_global_counters"); + policy->AddKernelObjectToClose(L"Section", object_path.data()); } // Adds the generic policy rules to a sandbox TargetPolicy. -- cgit v1.1