]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Plug memory leak in zip_read_local_file_header()
authorMartin Matuska <martin@matuska.org>
Tue, 31 Jan 2017 03:03:31 +0000 (04:03 +0100)
committerMartin Matuska <martin@matuska.org>
Tue, 31 Jan 2017 03:03:51 +0000 (04:03 +0100)
libarchive/archive_read_support_format_zip.c

index cde62ee62b9d6f77d4a0a05fbcfcf5767aef93ce..c8a9c148d97bedaf0c19dfab9679cab600ce34ae 100644 (file)
@@ -905,6 +905,7 @@ zip_read_local_file_header(struct archive_read *a, struct archive_entry *entry,
                                archive_wstrcat(&s, wp);
                                archive_wstrappend_wchar(&s, L'/');
                                archive_entry_copy_pathname_w(entry, s.s);
+                               archive_wstring_free(&s);
                        }
                } else {
                        cp = archive_entry_pathname(entry);
@@ -915,6 +916,7 @@ zip_read_local_file_header(struct archive_read *a, struct archive_entry *entry,
                                archive_strcat(&s, cp);
                                archive_strappend_char(&s, '/');
                                archive_entry_set_pathname(entry, s.s);
+                               archive_string_free(&s);
                        }
                }
        }