Date: Fri, 17 Apr 2009 01:02:57 +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: r191180 - head/lib/libarchive Message-ID: <200904170102.n3H12vUQ099789@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kientzle Date: Fri Apr 17 01:02:56 2009 New Revision: 191180 URL: http://svn.freebsd.org/changeset/base/191180 Log: Fix a memory leak: Release the current list of /set keywords even when we exit on an error. Modified: head/lib/libarchive/archive_read_support_format_mtree.c Modified: head/lib/libarchive/archive_read_support_format_mtree.c ============================================================================== --- head/lib/libarchive/archive_read_support_format_mtree.c Fri Apr 17 01:02:12 2009 (r191179) +++ head/lib/libarchive/archive_read_support_format_mtree.c Fri Apr 17 01:02:56 2009 (r191180) @@ -404,10 +404,13 @@ read_mtree(struct archive_read *a, struc len = readline(a, mtree, &p, 256); if (len == 0) { mtree->this_entry = mtree->entries; + free_options(global); return (ARCHIVE_OK); } - if (len < 0) + if (len < 0) { + free_options(global); return (len); + } /* Leading whitespace is never significant, ignore it. */ while (*p == ' ' || *p == '\t') { ++p; @@ -432,13 +435,16 @@ read_mtree(struct archive_read *a, struc } else break; - if (r != ARCHIVE_OK) + if (r != ARCHIVE_OK) { + free_options(global); return r; + } } archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, "Can't parse line %ju", counter); - return ARCHIVE_FATAL; + free_options(global); + return (ARCHIVE_FATAL); } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200904170102.n3H12vUQ099789>