From 205982039c7596ec14313c9b0692f7c4028e646f Mon Sep 17 00:00:00 2001 From: kientzle Date: Fri, 14 Mar 2008 22:40:36 +0000 Subject: [PATCH] Let archive_entry_clear() accept a NULL pointer and simply do nothing. In particular, this allows archive_entry_free() to work correctly for a NULL pointer, which makes it parallel with free(3). --- lib/libarchive/archive_entry.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libarchive/archive_entry.c b/lib/libarchive/archive_entry.c index 8ca69fe422b9..cc7e4d30582b 100644 --- a/lib/libarchive/archive_entry.c +++ b/lib/libarchive/archive_entry.c @@ -307,6 +307,8 @@ aes_copy_wcs_len(struct aes *aes, const wchar_t *wcs, size_t len) struct archive_entry * archive_entry_clear(struct archive_entry *entry) { + if (entry == NULL) + return (NULL); aes_clean(&entry->ae_fflags_text); aes_clean(&entry->ae_gname); aes_clean(&entry->ae_hardlink);