summaryrefslogtreecommitdiffstats
path: root/lib/libarchive/archive_entry.c
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2008-03-14 22:40:36 +0000
committerkientzle <kientzle@FreeBSD.org>2008-03-14 22:40:36 +0000
commit205982039c7596ec14313c9b0692f7c4028e646f (patch)
tree1332b07f793af722bfa8f7a08a71422ab5f5f01b /lib/libarchive/archive_entry.c
parent474ea5abd8ad2fd82dfdc8707cab3058ca4dd365 (diff)
downloadFreeBSD-src-205982039c7596ec14313c9b0692f7c4028e646f.zip
FreeBSD-src-205982039c7596ec14313c9b0692f7c4028e646f.tar.gz
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).
Diffstat (limited to 'lib/libarchive/archive_entry.c')
-rw-r--r--lib/libarchive/archive_entry.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libarchive/archive_entry.c b/lib/libarchive/archive_entry.c
index 8ca69fe..cc7e4d3 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);
OpenPOWER on IntegriCloud