From: Michihiro NAKAJIMA Date: Thu, 1 Nov 2012 11:09:43 +0000 (+0900) Subject: Plug memory leaks on Mac. X-Git-Tag: v3.1.0~39^2~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f356f0e04ceb6855e96e029428d7e773aa0befc3;p=thirdparty%2Flibarchive.git Plug memory leaks on Mac. --- diff --git a/libarchive/archive_write_disk_posix.c b/libarchive/archive_write_disk_posix.c index 23cc82d5e..fcd8406f9 100644 --- a/libarchive/archive_write_disk_posix.c +++ b/libarchive/archive_write_disk_posix.c @@ -3216,6 +3216,7 @@ set_mac_metadata(struct archive_write_disk *a, const char *pathname, if (fd < 0) { archive_set_error(&a->archive, errno, "Failed to restore metadata"); + archive_string_free(&tmp); return (ARCHIVE_WARN); } written = write(fd, metadata, metadata_size); @@ -3229,6 +3230,7 @@ set_mac_metadata(struct archive_write_disk *a, const char *pathname, ret = ARCHIVE_WARN; } unlink(tmp.s); + archive_string_free(&tmp); return (ret); } #endif