diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2016-02-09 15:00:19 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2016-02-09 16:54:20 +0100 |
commit | f17c1a2a06eb04daabd381e7e9f374c3f76e77fa (patch) | |
tree | b8de5f681a9363d83f3a3260e918556a7a1a141d | |
parent | 482d9590b54308e7b2f83cdf4180426c38444894 (diff) | |
download | mupdf-f17c1a2a06eb04daabd381e7e9f374c3f76e77fa.tar.xz |
Fix 696552: Double free error in mutool clean -s.
Also fix a memory leak.
-rw-r--r-- | source/pdf/pdf-clean.c | 3 |
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 { |