]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Free leaked archive_string in create_filesystem_object()
authorMartin Matuska <martin@matuska.org>
Tue, 31 Jan 2017 19:23:20 +0000 (20:23 +0100)
committerMartin Matuska <martin@matuska.org>
Tue, 31 Jan 2017 19:23:20 +0000 (20:23 +0100)
libarchive/archive_write_disk_posix.c

index 29d687bf2d626da90671bada3c8164992e563bc9..49e79dc23e9d3038cf7ac97926d719b774a0f405 100644 (file)
@@ -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