diff options
author | erikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-15 12:40:04 +0000 |
---|---|---|
committer | erikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-15 12:40:04 +0000 |
commit | 0148e6e18bfb076a51afb7be575c260248ed06aa (patch) | |
tree | e632219148b3743e55f5e305d623235fc5f15d50 /base/process_util_win.cc | |
parent | 1075da5df3dfec5adc6816aa2ac736d71c55a6c9 (diff) | |
download | chromium_src-0148e6e18bfb076a51afb7be575c260248ed06aa.zip chromium_src-0148e6e18bfb076a51afb7be575c260248ed06aa.tar.gz chromium_src-0148e6e18bfb076a51afb7be575c260248ed06aa.tar.bz2 |
Add comments and fix a potential leak in LaunchProcess.
I found a need to look at the implementation to confirm that process_handle would never be assigned to if the call failed. So I added a comment for future readers.
While doing so, I found an edge case where I think the process handle could be leaked.
BUG=None
TEST=Ask a random developer whether they must check process_handle if LaunchProcess returns false. If they look at process_util_*.cc, fail.
Review URL: http://codereview.chromium.org/9689081
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126890 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process_util_win.cc')
-rw-r--r-- | base/process_util_win.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/base/process_util_win.cc b/base/process_util_win.cc index 7730e8b..6864c63 100644 --- a/base/process_util_win.cc +++ b/base/process_util_win.cc @@ -349,6 +349,8 @@ bool LaunchProcess(const string16& cmdline, process_info.hProcess)) { DLOG(ERROR) << "Could not AssignProcessToObject."; KillProcess(process_info.hProcess, kProcessKilledExitCode, true); + CloseHandle(process_info.hProcess); + CloseHandle(process_info.hThread); return false; } |