summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-xref.c
diff options
context:
space:
mode:
authorSimon Bünzli <zeniko@gmail.com>2014-05-29 02:47:42 +0200
committerSimon Bünzli <zeniko@gmail.com>2014-05-29 02:47:42 +0200
commit803294993c0ec927678f80ffb317770a8785f83b (patch)
treec7244457c7a4334149e3b65dc3807b880c0f0b93 /source/pdf/pdf-xref.c
parent68b6b1ea0ec475bcf1fe706dd4ed06b96ebe9f28 (diff)
downloadmupdf-803294993c0ec927678f80ffb317770a8785f83b.tar.xz
fix memory leaks during PDF document creation
pdf_create_document leaks the trailer and in pdf-device.c many objects are inserted into dictionaries using pdf_dict_puts and leaked instead of using pdf_dict_puts_drop.
Diffstat (limited to 'source/pdf/pdf-xref.c')
-rw-r--r--source/pdf/pdf-xref.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c
index 57189ce4..02b935c8 100644
--- a/source/pdf/pdf-xref.c
+++ b/source/pdf/pdf-xref.c
@@ -2427,6 +2427,7 @@ pdf_document *pdf_create_document(fz_context *ctx)
pdf_dict_puts_drop(pages, "Count", pdf_new_int(doc, 0));
pdf_dict_puts_drop(pages, "Kids", pdf_new_array(doc, 1));
pdf_set_populating_xref_trailer(doc, trailer);
+ pdf_drop_obj(trailer);
}
fz_catch(ctx)
{