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:
Tim Kientzle 2008-03-14 22:40:36 +00:00
parent 42d1f7b4ba
commit d6f37be734

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