svn commit: r189419 - head/lib/libarchive
Tim Kientzle
kientzle at FreeBSD.org
Thu Mar 5 10:38:37 PST 2009
Author: kientzle
Date: Thu Mar 5 18:38:36 2009
New Revision: 189419
URL: http://svn.freebsd.org/changeset/base/189419
Log:
Merge r389 from libarchive.googlecode.com: Fix a memory
leak in ISO9660 handler structure whenever a file entry
has a nonsensical CE offset.
Modified:
head/lib/libarchive/archive_read_support_format_iso9660.c
Modified: head/lib/libarchive/archive_read_support_format_iso9660.c
==============================================================================
--- head/lib/libarchive/archive_read_support_format_iso9660.c Thu Mar 5 18:32:43 2009 (r189418)
+++ head/lib/libarchive/archive_read_support_format_iso9660.c Thu Mar 5 18:38:36 2009 (r189419)
@@ -414,8 +414,10 @@ archive_read_format_iso9660_read_header(
/* 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, st
{
struct file_info *parent;
+ if (file == NULL)
+ return;
+
if (file->refcount == 0) {
parent = file->parent;
archive_string_free(&file->name);
More information about the svn-src-all
mailing list