diff options
author | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-30 22:27:52 +0000 |
---|---|---|
committer | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-30 22:27:52 +0000 |
commit | 3190b5fcc78fb83115b8719167f928884c5bb337 (patch) | |
tree | 4700fdaeaa8c47eb3f2e722f916b8c7516369c1f /chrome/installer | |
parent | 82d14c4479bcfc8557679017e0f372577c22a43b (diff) | |
download | chromium_src-3190b5fcc78fb83115b8719167f928884c5bb337.zip chromium_src-3190b5fcc78fb83115b8719167f928884c5bb337.tar.gz chromium_src-3190b5fcc78fb83115b8719167f928884c5bb337.tar.bz2 |
FixIt: initalize values.
BUG=15338
Review URL: http://codereview.chromium.org/151085
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19677 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer')
-rw-r--r-- | chrome/installer/gcapi/gcapi.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/chrome/installer/gcapi/gcapi.cc b/chrome/installer/gcapi/gcapi.cc index ae07387..3f9804e 100644 --- a/chrome/installer/gcapi/gcapi.cc +++ b/chrome/installer/gcapi/gcapi.cc @@ -367,8 +367,8 @@ DLLEXPORT BOOL __stdcall LaunchGoogleChrome() { HANDLE process_handle = ::OpenProcess( PROCESS_DUP_HANDLE | PROCESS_QUERY_INFORMATION, TRUE, pid); if (process_handle != NULL) { - HANDLE process_token; - HANDLE user_token; + HANDLE process_token = NULL; + HANDLE user_token = NULL; if (::OpenProcessToken(process_handle, TOKEN_DUPLICATE | TOKEN_QUERY, &process_token) && ::DuplicateTokenEx(process_token, @@ -379,8 +379,10 @@ DLLEXPORT BOOL __stdcall LaunchGoogleChrome() { (::ImpersonateLoggedOnUser(user_token) != 0)) { impersonation_success = true; } - ::CloseHandle(user_token); - ::CloseHandle(process_token); + if (user_token) + ::CloseHandle(user_token); + if (process_token) + ::CloseHandle(process_token); ::CloseHandle(process_handle); } } |