summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--winsup/cygwin/ChangeLog4
-rw-r--r--winsup/cygwin/spawn.cc3
2 files changed, 6 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 1fd67e513..1cb69b9ef 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,9 @@
2006-01-27 Christopher Faylor <cgf@timesys.com>
+ * spawn.cc (spawn_guts): Fix potential handle leak when failing exec.
+
+2006-01-27 Christopher Faylor <cgf@timesys.com>
+
* exceptions.cc (inside_kernel): Fix to return true if we can't get the
name of the DLL for the given memory block since we are not in kernel
code.
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index 4e5982ce8..8edbf55eb 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -731,7 +731,8 @@ spawn_guts (const char * prog_arg, const char *const *argv,
myself->exec_sendsig = NULL;
}
res = -1;
- CloseHandle (moreinfo->myself_pinfo);
+ if (moreinfo->myself_pinfo)
+ CloseHandle (moreinfo->myself_pinfo);
goto out;
}