diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 1fd67e513..1cb69b9ef 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2006-01-27 Christopher Faylor + + * spawn.cc (spawn_guts): Fix potential handle leak when failing exec. + 2006-01-27 Christopher Faylor * exceptions.cc (inside_kernel): Fix to return true if we can't get the 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; }