summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-02-09 15:00:19 +0100
committerTor Andersson <tor.andersson@artifex.com>2016-02-09 16:54:20 +0100
commitf17c1a2a06eb04daabd381e7e9f374c3f76e77fa (patch)
treeb8de5f681a9363d83f3a3260e918556a7a1a141d
parent482d9590b54308e7b2f83cdf4180426c38444894 (diff)
downloadmupdf-f17c1a2a06eb04daabd381e7e9f374c3f76e77fa.tar.xz
Fix 696552: Double free error in mutool clean -s.
Also fix a memory leak.
-rw-r--r--source/pdf/pdf-clean.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/pdf/pdf-clean.c b/source/pdf/pdf-clean.c
index 3d34c1a1..8e1dc894 100644
--- a/source/pdf/pdf-clean.c
+++ b/source/pdf/pdf-clean.c
@@ -162,7 +162,8 @@ void pdf_clean_page_contents(fz_context *ctx, pdf_document *doc, pdf_page *page,
/* create a new object to replace the array */
new_obj = pdf_new_dict(ctx, doc, 1);
new_ref = pdf_new_ref(ctx, doc, new_obj);
- page->contents = contents = new_ref;
+ pdf_drop_obj(ctx, page->contents);
+ page->contents = contents = pdf_keep_obj(ctx, new_ref);
}
else
{