]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(exit): Beware to not free statically allocated list element.
authorUlrich Drepper <drepper@redhat.com>
Mon, 11 Oct 1999 04:35:54 +0000 (04:35 +0000)
committerUlrich Drepper <drepper@redhat.com>
Mon, 11 Oct 1999 04:35:54 +0000 (04:35 +0000)
stdlib/exit.c

index dc189556b497e2985f39b3e3c8e5b7a234719669..f44c519aa75080a9cd083ba46972b4b402a4ff24 100644 (file)
@@ -62,7 +62,10 @@ exit (int status)
 
       old = __exit_funcs;
       __exit_funcs = __exit_funcs->next;
-      free (old);
+      if (__exit_funcs != NULL)
+       /* Don't free the last element in the chain, this is the statically
+          allocate element.  */
+       free (old);
     }
 
 #ifdef HAVE_GNU_LD