From: Michihiro NAKAJIMA Date: Sun, 6 Dec 2009 16:13:31 +0000 (-0500) Subject: Properly cleanup hardlinked list. X-Git-Tag: v2.8.0~111 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3bbdd6b30b9e18ee10663523ae5d5356d88f3c1f;p=thirdparty%2Flibarchive.git Properly cleanup hardlinked list. SVN-Revision: 1708 --- diff --git a/libarchive/archive_read_support_format_xar.c b/libarchive/archive_read_support_format_xar.c index f4425fb6e..ecf116de0 100644 --- a/libarchive/archive_read_support_format_xar.c +++ b/libarchive/archive_read_support_format_xar.c @@ -832,11 +832,19 @@ static int xar_cleanup(struct archive_read *a) { struct xar *xar; + struct hdlink *hdlink; int i; int r = ARCHIVE_OK; xar = (struct xar *)(a->format->data); r = decompression_cleanup(a); + hdlink = xar->hdlink_list; + while (hdlink != NULL) { + struct hdlink *next = hdlink->next; + + free(hdlink); + hdlink = next; + } for (i = 0; i < xar->file_queue.used; i++) file_free(xar->file_queue.files[i]); while (xar->unknowntags != NULL) {