diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2018-08-12 22:29:13 +0800 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2018-08-14 20:56:54 +0800 |
commit | df3e707a46e6d8b19a87a979bd1bc424c5ea975f (patch) | |
tree | 3e9c321479f3b810cceece52da0c7648b1437b09 /source/tools/pdfshow.c | |
parent | dac34508c049d12c801416727652f94daed4fd4b (diff) | |
download | mupdf-df3e707a46e6d8b19a87a979bd1bc424c5ea975f.tar.xz |
Fix leak of PDF object in mutool show.
Diffstat (limited to 'source/tools/pdfshow.c')
-rw-r--r-- | source/tools/pdfshow.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/tools/pdfshow.c b/source/tools/pdfshow.c index 68feb9f8..76868e69 100644 --- a/source/tools/pdfshow.c +++ b/source/tools/pdfshow.c @@ -358,7 +358,11 @@ static void showpathroot(char *path) else if (!strcmp(part, "pages")) showpathpage(list); else if (isnumber(part)) - showpath(list, pdf_new_indirect(ctx, doc, atoi(part), 0)); + { + pdf_obj *num = pdf_new_indirect(ctx, doc, atoi(part), 0); + showpath(list, num); + pdf_drop_obj(ctx, num); + } else showpath(list, pdf_dict_gets(ctx, pdf_trailer(ctx, doc), part)); } |