changeset 95859:9ae1040f70e5

make unexec_free handle NULL the same way free does * unexmacosx.c (unexec_free): Ignore a NULL argument.
author Jim Meyering <jim@meyering.net>
date Thu, 12 Jun 2008 22:53:07 +0000
parents d719efd8c628
children 353a9f7910cf
files src/ChangeLog src/unexmacosx.c
diffstat 2 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Thu Jun 12 20:53:18 2008 +0000
+++ b/src/ChangeLog	Thu Jun 12 22:53:07 2008 +0000
@@ -1,3 +1,8 @@
+2008-06-12  Jim Meyering  <meyering@redhat.com>
+
+	make unexec_free handle NULL the same way free does
+	* unexmacosx.c (unexec_free): Ignore a NULL argument.
+
 2008-06-12  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* character.h (CHAR_TO_BYTE_SAFE): New macro.
--- a/src/unexmacosx.c	Thu Jun 12 20:53:18 2008 +0000
+++ b/src/unexmacosx.c	Thu Jun 12 22:53:07 2008 +0000
@@ -1318,6 +1318,8 @@
 void
 unexec_free (void *ptr)
 {
+  if (ptr == NULL)
+    return;
   if (in_dumped_exec)
     {
       if (!ptr_in_unexec_regions (ptr))