Commit 17ddfd15 authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

Avoid leaking handles on MS-Windows.

 src/w32proc.c (new_child): Avoid leaking handles if the subprocess
 resources were not orderly released.
parent c1b9b2c2
2013-02-18 Eli Zaretskii <eliz@gnu.org>
* w32proc.c (new_child): Avoid leaking handles if the subprocess
resources were not orderly released.
2013-02-17 Eli Zaretskii <eliz@gnu.org>
* w32proc.c (new_child): Remove the loop that attempted to salvage
......
......@@ -802,6 +802,12 @@ new_child (void)
cp = &child_procs[child_proc_count++];
Initialize:
/* Last opportunity to avoid leaking handles before we forget them
for good. */
if (cp->procinfo.hProcess)
CloseHandle (cp->procinfo.hProcess);
if (cp->procinfo.hThread)
CloseHandle (cp->procinfo.hThread);
memset (cp, 0, sizeof (*cp));
cp->fd = -1;
cp->pid = -1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment