summary refs log tree commit diff
path: root/stdlib
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-10-11 04:34:14 +0000
committerUlrich Drepper <drepper@redhat.com>1999-10-11 04:34:14 +0000
commitbca9f4abe86e3ba2d84cb5ff96d55fe9d5afc722 (patch)
tree28f5fbfadeeba39d4ef3e85dfec8f5252ad5a168 /stdlib
parentcc97b1e5f0c84830f4937f2417928dd4d5f858b8 (diff)
downloadglibc-bca9f4abe86e3ba2d84cb5ff96d55fe9d5afc722.tar.gz
glibc-bca9f4abe86e3ba2d84cb5ff96d55fe9d5afc722.tar.xz
glibc-bca9f4abe86e3ba2d84cb5ff96d55fe9d5afc722.zip
Fix typo.
	* stdlib/exit.c (exit): Beware to not free statically allocated
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/exit.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/stdlib/exit.c b/stdlib/exit.c
index dc189556b4..f44c519aa7 100644
--- a/stdlib/exit.c
+++ b/stdlib/exit.c
@@ -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