summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2009-03-05 18:38:36 +0000
committerkientzle <kientzle@FreeBSD.org>2009-03-05 18:38:36 +0000
commit2e09215948493b8a27f556f367964677ab5d0d1c (patch)
tree0ea65107491b7a1636e776ce2825d123d84cd8bd
parentb2f198587d468439e294bea73d2a87118047ed85 (diff)
downloadFreeBSD-src-2e09215948493b8a27f556f367964677ab5d0d1c.zip
FreeBSD-src-2e09215948493b8a27f556f367964677ab5d0d1c.tar.gz
Merge r389 from libarchive.googlecode.com: Fix a memory
leak in ISO9660 handler structure whenever a file entry has a nonsensical CE offset.
-rw-r--r--lib/libarchive/archive_read_support_format_iso9660.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/libarchive/archive_read_support_format_iso9660.c b/lib/libarchive/archive_read_support_format_iso9660.c
index ab96a27..c124c71 100644
--- a/lib/libarchive/archive_read_support_format_iso9660.c
+++ b/lib/libarchive/archive_read_support_format_iso9660.c
@@ -414,8 +414,10 @@ archive_read_format_iso9660_read_header(struct archive_read *a,
/* Get the next entry that appears after the current offset. */
r = next_entry_seek(a, iso9660, &file);
- if (r != ARCHIVE_OK)
+ if (r != ARCHIVE_OK) {
+ release_file(iso9660, file);
return (r);
+ }
iso9660->entry_bytes_remaining = file->size;
iso9660->entry_sparse_offset = 0; /* Offset for sparse-file-aware clients. */
@@ -1093,6 +1095,9 @@ release_file(struct iso9660 *iso9660, struct file_info *file)
{
struct file_info *parent;
+ if (file == NULL)
+ return;
+
if (file->refcount == 0) {
parent = file->parent;
archive_string_free(&file->name);
OpenPOWER on IntegriCloud