summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-07-29 14:22:56 +0000
committerChristopher Faylor <me@cgf.cx>2005-07-29 14:22:56 +0000
commitf834829deef081c859556770c54679d622d1c08e (patch)
tree0e4fde828424a460ddedffa50e7b974e18e2d356
parente61d5b97903cbe83b2214e8868e44f68399b0679 (diff)
downloadcygnal-f834829deef081c859556770c54679d622d1c08e.tar.gz
cygnal-f834829deef081c859556770c54679d622d1c08e.tar.bz2
cygnal-f834829deef081c859556770c54679d622d1c08e.zip
* fork.cc (fork_parent): Fix null deref if pinfo creation fails.
-rw-r--r--winsup/cygwin/ChangeLog4
-rw-r--r--winsup/cygwin/fork.cc5
2 files changed, 7 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 03e41da5b..10b9a1bd4 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,7 @@
+2005-07-29 Arto Huusko <arto.huusko@wmdata.fi>
+
+ * fork.cc (fork_parent): Fix null deref if pinfo creation fails.
+
2005-07-28 Christopher Faylor <cgf@timesys.com>
* cygmalloc.h (MSPACES): Define. This dropped through the cracks after
diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc
index 649baa3e3..6ed515b64 100644
--- a/winsup/cygwin/fork.cc
+++ b/winsup/cygwin/fork.cc
@@ -370,8 +370,6 @@ fork_parent (HANDLE&, dll *&first_dll, bool& load_dlls, void *stack_here, child_
int child_pid = cygwin_pid (pi.dwProcessId);
pinfo child (child_pid, 1);
- child->start_time = time (NULL); /* Register child's starting time. */
- child->nice = myself->nice;
if (!child)
{
@@ -381,6 +379,9 @@ fork_parent (HANDLE&, dll *&first_dll, bool& load_dlls, void *stack_here, child_
goto cleanup;
}
+ child->start_time = time (NULL); /* Register child's starting time. */
+ child->nice = myself->nice;
+
/* Initialize things that are done later in dll_crt0_1 that aren't done
for the forkee. */
strcpy (child->progname, myself->progname);