From df3e707a46e6d8b19a87a979bd1bc424c5ea975f Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Sun, 12 Aug 2018 22:29:13 +0800 Subject: Fix leak of PDF object in mutool show. --- source/tools/pdfshow.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)); } -- cgit v1.2.3