From: Martin Matuska Date: Tue, 31 Jan 2017 19:23:20 +0000 (+0100) Subject: Free leaked archive_string in create_filesystem_object() X-Git-Tag: v3.3.0~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=532ff5fb6f81afcedd056898a1f5438045a01f97;p=thirdparty%2Flibarchive.git Free leaked archive_string in create_filesystem_object() --- diff --git a/libarchive/archive_write_disk_posix.c b/libarchive/archive_write_disk_posix.c index 29d687bf2..49e79dc23 100644 --- a/libarchive/archive_write_disk_posix.c +++ b/libarchive/archive_write_disk_posix.c @@ -2092,6 +2092,7 @@ create_filesystem_object(struct archive_write_disk *a) archive_set_error(&a->archive, error_number, "%s", error_string.s); free(linkname_copy); + archive_string_free(&error_string); /* * EPERM is more appropriate than error_number for our * callers @@ -2104,6 +2105,7 @@ create_filesystem_object(struct archive_write_disk *a) archive_set_error(&a->archive, error_number, "%s", error_string.s); free(linkname_copy); + archive_string_free(&error_string); /* * EPERM is more appropriate than error_number for our * callers @@ -2111,6 +2113,7 @@ create_filesystem_object(struct archive_write_disk *a) return (EPERM); } free(linkname_copy); + archive_string_free(&error_string); r = link(linkname, a->name) ? errno : 0; /* * New cpio and pax formats allow hardlink entries