summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2014-04-06 16:05:51 +0200
committerAlbert Astals Cid <aacid@kde.org>2014-04-06 16:08:15 +0200
commitb8325316e41fb03eb5fac5c80d6a550fe9ce9695 (patch)
treea8b3cbe512a5b3ec7d5a3505d53620b47ead6652 /utils
parentca9713118d6ce3fdd245f9ca4f595229a5be19c3 (diff)
Fix memory leak
CID #16943
Diffstat (limited to 'utils')
-rw-r--r--utils/pdfseparate.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/pdfseparate.cc b/utils/pdfseparate.cc
index 78dbf129..31dc18ce 100644
--- a/utils/pdfseparate.cc
+++ b/utils/pdfseparate.cc
@@ -5,7 +5,7 @@
// This file is licensed under the GPLv2 or later
//
// Copyright (C) 2011, 2012 Thomas Freitag <Thomas.Freitag@alfa.de>
-// Copyright (C) 2012, 2013 Albert Astals Cid <aacid@kde.org>
+// Copyright (C) 2012-2014 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2013 Pino Toscano <pino@kde.org>
// Copyright (C) 2013 Daniel Kahn Gillmor <dkg@fifthhorseman.net>
// Copyright (C) 2013 Suzuki Toshiya <mpsuzuki@hiroshima-u.ac.jp>
@@ -62,7 +62,6 @@ bool extractPages (const char *srcFileName, const char *destFileName) {
// by 'A' (random char that is not %), if at the end of replacing
// any of the valid appearances there is still any % around, the
// pattern is wrong
- char *auxDestFileName = strdup(destFileName);
if (firstPage == 0 && lastPage == 0) {
firstPage = 1;
lastPage = doc->getNumPages();
@@ -78,6 +77,7 @@ bool extractPages (const char *srcFileName, const char *destFileName) {
return false;
}
bool foundmatch = false;
+ char *auxDestFileName = strdup(destFileName);
char *p = strstr(auxDestFileName, "%d");
if (p != NULL) {
foundmatch = true;