From 80e4786f5a0673c37821ba373e78c4fb58274314 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Mon, 11 Apr 2016 18:00:39 +0100 Subject: Bug 696696: Avoid leak when cleaning with sanitize. If we rewrite a page content stream, and then drop that entire page we shouldn't leak the buffer. Or to put it another way, when we change the obj for an xref entry, ditch the cached stm_buf. --- source/pdf/pdf-xref.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/pdf/pdf-xref.c') diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c index 6eca8a74..e915b600 100644 --- a/source/pdf/pdf-xref.c +++ b/source/pdf/pdf-xref.c @@ -1735,7 +1735,11 @@ pdf_load_obj_stm(fz_context *ctx, pdf_document *doc, int num, int gen, pdf_lexbu pdf_drop_obj(ctx, obj); } else + { entry->obj = obj; + fz_drop_buffer(ctx, entry->stm_buf); + entry->stm_buf = NULL; + } if (numbuf[i] == target) ret_entry = entry; } -- cgit v1.2.3