From: Martin Matuska Date: Tue, 4 Oct 2016 10:09:28 +0000 (+0200) Subject: Properly free and close when exiting write_hierarchy() on failed X-Git-Tag: v3.2.2~9^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=024be27d1b299c030e8841bed3002ee07ba9eedc;p=thirdparty%2Flibarchive.git Properly free and close when exiting write_hierarchy() on failed archive_read_next_header2(). Fixes #794 --- diff --git a/tar/write.c b/tar/write.c index 2d076f488..da5a12825 100644 --- a/tar/write.c +++ b/tar/write.c @@ -886,6 +886,8 @@ write_hierarchy(struct bsdtar *bsdtar, struct archive *a, const char *path) "%s", archive_error_string(disk)); if (r == ARCHIVE_FATAL || r == ARCHIVE_FAILED) { bsdtar->return_value = 1; + archive_entry_free(entry); + archive_read_close(disk); return; } else if (r < ARCHIVE_WARN) continue;