diff options
author | kientzle <kientzle@FreeBSD.org> | 2004-04-13 23:45:37 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2004-04-13 23:45:37 +0000 |
commit | 5c2c79eafdaffd172c20dd2cebc96f3dea266b96 (patch) | |
tree | 6b324c0c8fe5322b967c90baad9fbf3b820f985f /lib/libarchive/archive_write_set_format_pax.c | |
parent | 2d52f8e62f64e1c72b250c97a58a6e324d6b62d4 (diff) | |
download | FreeBSD-src-5c2c79eafdaffd172c20dd2cebc96f3dea266b96.zip FreeBSD-src-5c2c79eafdaffd172c20dd2cebc96f3dea266b96.tar.gz |
* Plug a buffer overrun in ACL parsing. (archive_entry.c)
* Re-use a single buffer for shar output formatting rather
than hammering the heap. (archive_write_set_format_shar.c)
* Fix a handful of minor memory leaks and clean up some of the
memory-management code.
Diffstat (limited to 'lib/libarchive/archive_write_set_format_pax.c')
-rw-r--r-- | lib/libarchive/archive_write_set_format_pax.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/libarchive/archive_write_set_format_pax.c b/lib/libarchive/archive_write_set_format_pax.c index 503062c..efa38e2 100644 --- a/lib/libarchive/archive_write_set_format_pax.c +++ b/lib/libarchive/archive_write_set_format_pax.c @@ -611,7 +611,7 @@ archive_write_pax_header(struct archive *a, pax_attr_entry, 'x'); archive_entry_free(pax_attr_entry); - free(pax_entry_name.s); + archive_string_free(&pax_entry_name); /* Note that the 'x' header shouldn't ever fail to format */ if (ret != 0) { @@ -765,12 +765,16 @@ static int archive_write_pax_finish(struct archive *a) { struct pax *pax; + int r; + + r = ARCHIVE_OK; pax = a->format_data; if (pax->written && a->compression_write != NULL) - return (write_nulls(a, 512 * 2)); + r = write_nulls(a, 512 * 2); + archive_string_free(&pax->pax_header); free(pax); a->format_data = NULL; - return (ARCHIVE_OK); + return (r); } static int |