From b24ea9b71e37fc3e2164752094ab9f85da410036 Mon Sep 17 00:00:00 2001 From: tastytea Date: Thu, 27 May 2021 19:49:32 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20memory=20leak.=20=F0=9F=A4=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit That's why I don't write C. 😄 This seems to fix issue #6 in single-threaded mode but sometimes throws “double free or corruption (out)” in multi-threaded mode. Bug: https://schlomp.space/tastytea/epubgrep/issues/6 --- src/zip.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/zip.cpp b/src/zip.cpp index 12d0fa6..121b824 100644 --- a/src/zip.cpp +++ b/src/zip.cpp @@ -74,6 +74,7 @@ std::string read_file(const fs::path &filepath, std::string_view entry_path) entry_path, filepath.string())}; } + close_file(zipfile, filepath); return filecontents; } archive_read_data_skip(zipfile);