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

Unified Diff: chrome/installer/gcapi/gcapi.cc

Issue 151085: FixIt: initalize values. (Closed)
Patch Set: temp Created 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/gcapi/gcapi.cc
diff --git a/chrome/installer/gcapi/gcapi.cc b/chrome/installer/gcapi/gcapi.cc
index 43498b96d04765d88a68a7fc36b953bd167b6fa0..4b06d79414f4b5ac9a37880751b955a3bb004c4b 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);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698