summaryrefslogtreecommitdiff
path: root/source/pdf
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2015-02-17 20:39:24 +0100
committerTor Andersson <tor.andersson@artifex.com>2015-02-17 20:39:24 +0100
commit2ea1295e49e3e7a0873aac5a6345dd5759760d77 (patch)
treeb1e1ff6360c670da8872a95fb6246ff8aae33185 /source/pdf
parent31186b61d979ba02c04ce68dcb66f7a5f1229c93 (diff)
downloadmupdf-2ea1295e49e3e7a0873aac5a6345dd5759760d77.tar.xz
Fix memory leak in fz_page.
Diffstat (limited to 'source/pdf')
-rw-r--r--source/pdf/js/pdf-js.c1
-rw-r--r--source/pdf/pdf-page.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/source/pdf/js/pdf-js.c b/source/pdf/js/pdf-js.c
index 008cebfb..84a14381 100644
--- a/source/pdf/js/pdf-js.c
+++ b/source/pdf/js/pdf-js.c
@@ -338,6 +338,7 @@ static pdf_jsimp_obj *field_getValue(void *jsctx, void *obj)
return NULL;
fval = pdf_field_value(js->ctx, js->doc, field);
+ /* TODO: free fval! */
return pdf_jsimp_from_string(js->imp, fval?fval:"");
}
diff --git a/source/pdf/pdf-page.c b/source/pdf/pdf-page.c
index c9c92307..7917afbf 100644
--- a/source/pdf/pdf-page.c
+++ b/source/pdf/pdf-page.c
@@ -440,7 +440,7 @@ pdf_load_page(fz_context *ctx, pdf_document *doc, int number)
pageref = pdf_lookup_page_obj(ctx, doc, number);
pageobj = pdf_resolve_indirect(ctx, pageref);
- page = fz_malloc_struct(ctx, pdf_page);
+ page = fz_new_page(ctx, sizeof *page);
page->doc = (pdf_document*) fz_keep_document(ctx, &doc->super);
page->super.drop_page_imp = (fz_page_drop_page_imp_fn *)pdf_drop_page_imp;