[poppler] utils/JSInfo.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Mon Mar 6 21:43:49 UTC 2017


 utils/JSInfo.cc |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit d30e66cf39ef69a81bdd91e21203c876f38d9a09
Author: Albert Astals Cid <aacid at kde.org>
Date:   Mon Mar 6 22:43:27 2017 +0100

    pdfinfo: fix leak when printing JS

diff --git a/utils/JSInfo.cc b/utils/JSInfo.cc
index 71bfde9..0028239 100644
--- a/utils/JSInfo.cc
+++ b/utils/JSInfo.cc
@@ -5,7 +5,7 @@
 // This file is licensed under the GPLv2 or later
 //
 // Copyright (C) 2013 Adrian Johnson <ajohnson at redneon.com>
-// Copyright (C) 2016 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2016, 2017 Albert Astals Cid <aacid at kde.org>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -111,7 +111,9 @@ void JSInfo::scan(int nPages) {
     if (print) {
       for (int i = 0; i < numNames; i++) {
 	fprintf(file, "Name Dictionary \"%s\":\n", doc->getCatalog()->getJSName(i)->getCString());
-	printJS(doc->getCatalog()->getJS(i));
+	GooString *js = doc->getCatalog()->getJS(i);
+	printJS(js);
+	delete js;
 	fputs("\n\n", file);
       }
     }


More information about the poppler mailing list