From 6b5582e8206f2cdd3afeb4e32ebbe5d144334da7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20B=C3=BCnzli?= Date: Fri, 12 Dec 2014 15:39:32 +0100 Subject: fix memory leaks Commit 5add23c7233c3f34fdfa6387873b1d3bdb93e1d6 and commit 2f4cdd4fd0580e3121773e89a7c6e7a9e1ffa54b introduced three memory leaks which only appear in error cases: * unzip.c leaks if a ZIP archive uses a compression method other than store or Deflate * xps-zip.c leaks if fz_open_archive_with_stream throws for broken ZIP archives * xps-zip.c leaks also if a piece of a split file is missing --- source/fitz/unzip.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source/fitz/unzip.c') diff --git a/source/fitz/unzip.c b/source/fitz/unzip.c index 73905e81..f13a9ace 100644 --- a/source/fitz/unzip.c +++ b/source/fitz/unzip.c @@ -372,6 +372,7 @@ static fz_buffer *read_zip_entry(fz_context *ctx, fz_archive *zip, struct zip_en return ubuf; } + fz_drop_buffer(ctx, ubuf); fz_throw(ctx, FZ_ERROR_GENERIC, "unknown zip method: %d", method); } -- cgit v1.2.3