MfP4: Joerg Sonnenberger's fixes to make 'ar' and 'pax' writers
robust against multiple calls to their destroy() functions.
This commit is contained in:
parent
d09ece9e4e
commit
07fe09e227
@ -389,6 +389,9 @@ archive_write_ar_destroy(struct archive_write *a)
|
||||
|
||||
ar = (struct ar_w *)a->format_data;
|
||||
|
||||
if (ar == NULL)
|
||||
return (ARCHIVE_OK);
|
||||
|
||||
if (ar->has_strtab > 0) {
|
||||
free(ar->strtab);
|
||||
ar->strtab = NULL;
|
||||
|
@ -1200,6 +1200,9 @@ archive_write_pax_destroy(struct archive_write *a)
|
||||
struct pax *pax;
|
||||
|
||||
pax = (struct pax *)a->format_data;
|
||||
if (pax == NULL)
|
||||
return (ARCHIVE_OK);
|
||||
|
||||
archive_string_free(&pax->pax_header);
|
||||
free(pax);
|
||||
a->format_data = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user