Date: Thu, 5 Mar 2009 18:38:37 +0000 (UTC) From: Tim Kientzle <kientzle@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r189419 - head/lib/libarchive Message-ID: <200903051838.n25IcbTo096288@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903051838.n25IcbTo096288>