summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2017-03-06 22:45:52 +0100
committerAlbert Astals Cid <aacid@kde.org>2017-03-06 22:45:52 +0100
commitaa8633267d1d0e2079bb4a2b82bc7b36a4d306f5 (patch)
tree166add427e3fb9b581fbb20216a74fa04ad7fc55
parentd30e66cf39ef69a81bdd91e21203c876f38d9a09 (diff)
pdfinfo: Fix memory leak when printing JS
-rw-r--r--utils/JSInfo.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/utils/JSInfo.cc b/utils/JSInfo.cc
index 00282391..17b10329 100644
--- a/utils/JSInfo.cc
+++ b/utils/JSInfo.cc
@@ -34,7 +34,7 @@ JSInfo::~JSInfo() {
}
void JSInfo::printJS(GooString *js) {
- Unicode *u;
+ Unicode *u = NULL;
char buf[8];
int i, n, len;
@@ -46,6 +46,7 @@ void JSInfo::printJS(GooString *js) {
n = uniMap->mapUnicode(u[i], buf, sizeof(buf));
fwrite(buf, 1, n, file);
}
+ gfree(u);
}
void JSInfo::scanLinkAction(LinkAction *link, const char *action, bool deleteLink) {