OSDN Git Service

* spawn.cc (spawn_guts): Fix potential handle leak when failing exec.
authorcgf <cgf>
Fri, 27 Jan 2006 06:08:05 +0000 (06:08 +0000)
committercgf <cgf>
Fri, 27 Jan 2006 06:08:05 +0000 (06:08 +0000)
winsup/cygwin/ChangeLog
winsup/cygwin/spawn.cc

index 1fd67e5..1cb69b9 100644 (file)
@@ -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.
index 4e5982c..8edbf55 100644 (file)
@@ -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;
     }