From: Joerg Sonnenberger Date: Sat, 19 Oct 2019 15:15:05 +0000 (+0200) Subject: When the initial archive open for write fails, explicitly free filters. X-Git-Tag: v3.4.1~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=18fc5023c4bd66c2623f363b5f4c859406b7df15;p=thirdparty%2Flibarchive.git When the initial archive open for write fails, explicitly free filters. This provides a defense-in-depth against programming errors due to the partial state. Based on a report from Airbus Security - Vulnerability Management. --- diff --git a/libarchive/archive_write.c b/libarchive/archive_write.c index 9fa46bf5e..1c40e9769 100644 --- a/libarchive/archive_write.c +++ b/libarchive/archive_write.c @@ -486,6 +486,7 @@ archive_write_open(struct archive *_a, void *client_data, ret = __archive_write_open_filter(a->filter_first); if (ret < ARCHIVE_WARN) { r1 = __archive_write_close_filter(a); + __archive_write_filters_free(_a); return (r1 < ret ? r1 : ret); }