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:
parent
42d1f7b4ba
commit
d6f37be734
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user