summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2017-03-06 22:43:27 +0100
committerAlbert Astals Cid <aacid@kde.org>2017-03-06 22:43:27 +0100
commitd30e66cf39ef69a81bdd91e21203c876f38d9a09 (patch)
tree010bbe04050eafb90fe8b274827fbc49fd7a6562
parenta7632c5db6875828500dce7c984ec933d5349f26 (diff)
pdfinfo: fix leak when printing JS
-rw-r--r--utils/JSInfo.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/utils/JSInfo.cc b/utils/JSInfo.cc
index 71bfde9c..00282391 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@redneon.com>
-// Copyright (C) 2016 Albert Astals Cid <aacid@kde.org>
+// Copyright (C) 2016, 2017 Albert Astals Cid <aacid@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);
}
}