Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2006-01-27 09:08:05 +0300
committerChristopher Faylor <me@cgf.cx>2006-01-27 09:08:05 +0300
commite7a9c71d623f88b6d41a769b0ec8e223a958175d (patch)
treec55755b0947f81ed39c52e06e92d844c59a2206f /winsup
parente1bfb483ea6056fa964d2e2b983b68147a0c5920 (diff)
* spawn.cc (spawn_guts): Fix potential handle leak when failing exec.
Diffstat (limited to 'winsup')
-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;
}