From 9c5e177ecf929a3c4aaf76133dbe3eacac124b2b Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 12 Jun 2008 22:53:07 +0000 Subject: [PATCH] make unexec_free handle NULL the same way free does * unexmacosx.c (unexec_free): Ignore a NULL argument. --- src/ChangeLog | 5 +++++ src/unexmacosx.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 6361f522fe7..a936794edc7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2008-06-12 Jim Meyering + + make unexec_free handle NULL the same way free does + * unexmacosx.c (unexec_free): Ignore a NULL argument. + 2008-06-12 Stefan Monnier * character.h (CHAR_TO_BYTE_SAFE): New macro. diff --git a/src/unexmacosx.c b/src/unexmacosx.c index 46622601281..57f70f8557f 100644 --- a/src/unexmacosx.c +++ b/src/unexmacosx.c @@ -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)) -- 2.39.2