make unexec_free handle NULL the same way free does
authorJim Meyering <jim@meyering.net>
Thu, 12 Jun 2008 22:53:07 +0000 (22:53 +0000)
committerJim Meyering <jim@meyering.net>
Thu, 12 Jun 2008 22:53:07 +0000 (22:53 +0000)
* unexmacosx.c (unexec_free): Ignore a NULL argument.

src/ChangeLog
src/unexmacosx.c

index 6361f52..a936794 100644 (file)
@@ -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.
index 4662260..57f70f8 100644 (file)
@@ -1318,6 +1318,8 @@ unexec_realloc (void *old_ptr, size_t new_size)
 void
 unexec_free (void *ptr)
 {
+  if (ptr == NULL)
+    return;
   if (in_dumped_exec)
     {
       if (!ptr_in_unexec_regions (ptr))