From 0148e6e18bfb076a51afb7be575c260248ed06aa Mon Sep 17 00:00:00 2001 From: "erikwright@chromium.org" Date: Thu, 15 Mar 2012 12:40:04 +0000 Subject: 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 --- base/process_util_win.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'base/process_util_win.cc') 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; } -- cgit v1.1