diff options
author | kientzle <kientzle@FreeBSD.org> | 2008-08-10 02:06:28 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2008-08-10 02:06:28 +0000 |
commit | 58af11b81526af878c816be97daf317a54c691a5 (patch) | |
tree | e18941f54d0ceed797a9254e4a8e26e3dd4b8ba3 /lib/libarchive | |
parent | 38a03c756ca71eefaadb9fa9ceedf8787bf87fa1 (diff) | |
download | FreeBSD-src-58af11b81526af878c816be97daf317a54c691a5.zip FreeBSD-src-58af11b81526af878c816be97daf317a54c691a5.tar.gz |
MfP4: Joerg Sonnenberger's fixes to make 'ar' and 'pax' writers
robust against multiple calls to their destroy() functions.
Diffstat (limited to 'lib/libarchive')
-rw-r--r-- | lib/libarchive/archive_write_set_format_ar.c | 3 | ||||
-rw-r--r-- | lib/libarchive/archive_write_set_format_pax.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/libarchive/archive_write_set_format_ar.c b/lib/libarchive/archive_write_set_format_ar.c index e6a9d90..453cf3c 100644 --- a/lib/libarchive/archive_write_set_format_ar.c +++ b/lib/libarchive/archive_write_set_format_ar.c @@ -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; diff --git a/lib/libarchive/archive_write_set_format_pax.c b/lib/libarchive/archive_write_set_format_pax.c index b40aec5..001e0a2 100644 --- a/lib/libarchive/archive_write_set_format_pax.c +++ b/lib/libarchive/archive_write_set_format_pax.c @@ -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; |