summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/fitz/unzip.c1
-rw-r--r--source/xps/xps-zip.c3
2 files changed, 3 insertions, 1 deletions
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);
}
diff --git a/source/xps/xps-zip.c b/source/xps/xps-zip.c
index e3d006ba..4f524752 100644
--- a/source/xps/xps-zip.c
+++ b/source/xps/xps-zip.c
@@ -85,6 +85,7 @@ xps_read_part(xps_document *doc, char *partname)
}
else
{
+ fz_drop_buffer(ctx, buf);
fz_throw(ctx, FZ_ERROR_GENERIC, "cannot find all pieces for part '%s'", partname);
}
}
@@ -149,10 +150,10 @@ xps_open_document_with_stream(fz_context *ctx, fz_stream *file)
doc = fz_malloc_struct(ctx, xps_document);
xps_init_document(doc);
doc->ctx = ctx;
- doc->zip = fz_open_archive_with_stream(ctx, file);
fz_try(ctx)
{
+ doc->zip = fz_open_archive_with_stream(ctx, file);
xps_read_page_list(doc);
}
fz_catch(ctx)