summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Henrie <alexhenrie24@gmail.com>2020-03-11 17:06:16 -0600
committerAlex Henrie <alexhenrie24@gmail.com>2020-03-11 17:06:16 -0600
commitaf5565087b63aebfbb20a155dd9318312f688f92 (patch)
tree0f86f4768a51b99ec9497ae41d5fd4d57d44ba73
parentf1480aa0720b3f2d4d12b6e1b4370e2ced4c06f2 (diff)
Fix memory leak in HtmlOutputDev::getLinkDest
-rw-r--r--utils/HtmlOutputDev.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/utils/HtmlOutputDev.cc b/utils/HtmlOutputDev.cc
index 0212626b..5be687ab 100644
--- a/utils/HtmlOutputDev.cc
+++ b/utils/HtmlOutputDev.cc
@@ -1546,7 +1546,6 @@ GooString* HtmlOutputDev::getLinkDest(AnnotLink *link){
{
case actionGoTo:
{
- GooString* file = new GooString(gbasename(Docname->c_str()));
int destPage=1;
LinkGoTo *ha=(LinkGoTo *)link->getAction();
std::unique_ptr<LinkDest> dest;
@@ -1556,6 +1555,8 @@ GooString* HtmlOutputDev::getLinkDest(AnnotLink *link){
dest=catalog->findDest(ha->getNamedDest());
if (dest){
+ GooString* file = new GooString(gbasename(Docname->c_str()));
+
if (dest->isPageRef()){
const Ref pageref=dest->getPageRef();
destPage=catalog->findPage(pageref);