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).
This commit is contained in:
kientzle 2008-03-14 22:40:36 +00:00
parent 474ea5abd8
commit 205982039c

View File

@ -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);