summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2013-06-13 17:16:40 +0100
committerRobin Watts <robin.watts@artifex.com>2013-06-13 17:17:50 +0100
commitd581118e2d0ff407cfb918fcdd76b220d798725b (patch)
tree73d49a85f89051fdac1dd9c73e2029902a374c08
parent96a4c676db95c1d8a3ca98e847608786da2b6aae (diff)
downloadmupdf-d581118e2d0ff407cfb918fcdd76b220d798725b.tar.xz
Bug 694313: Fix potential double frees of objects
Thanks to zeniko for spotting these.
-rw-r--r--pdf/pdf_repair.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pdf/pdf_repair.c b/pdf/pdf_repair.c
index 4240e305..20b5b469 100644
--- a/pdf/pdf_repair.c
+++ b/pdf/pdf_repair.c
@@ -411,6 +411,7 @@ pdf_repair_xref(pdf_document *xref, pdf_lexbuf *buf)
}
pdf_drop_obj(dict);
+ obj = NULL;
}
else if (tok == PDF_TOK_ERROR)
@@ -504,6 +505,7 @@ pdf_repair_xref(pdf_document *xref, pdf_lexbuf *buf)
obj = pdf_new_indirect(ctx, pdf_to_num(encrypt), pdf_to_gen(encrypt), xref);
pdf_drop_obj(encrypt);
encrypt = obj;
+ obj = NULL;
}
pdf_dict_puts(pdf_trailer(xref), "Encrypt", encrypt);
pdf_drop_obj(encrypt);
@@ -518,6 +520,7 @@ pdf_repair_xref(pdf_document *xref, pdf_lexbuf *buf)
obj = pdf_new_indirect(ctx, pdf_to_num(id), pdf_to_gen(id), xref);
pdf_drop_obj(id);
id = obj;
+ obj = NULL;
}
pdf_dict_puts(pdf_trailer(xref), "ID", id);
pdf_drop_obj(id);