summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2014-04-06 15:35:00 +0200
committerAlbert Astals Cid <aacid@kde.org>2014-04-06 16:08:14 +0200
commit9309907673e8557a25021dce79d9b4354640e2d0 (patch)
tree79675072158f85d3d2a0715fe3957da7d5f1f4d8
parenta511005584a38217fed582ced6ce2c937526cf96 (diff)
Fix memory leak
Don't pass new'ed GooStrings as parameters to error() CID #16915
-rw-r--r--poppler/GfxFont.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/poppler/GfxFont.cc b/poppler/GfxFont.cc
index 9eadcc79..5a13eca7 100644
--- a/poppler/GfxFont.cc
+++ b/poppler/GfxFont.cc
@@ -764,8 +764,8 @@ GfxFontLoc *GfxFont::locateFont(XRef *xref, GBool ps) {
}
substName = new GooString(base14SubstFonts[substIdx]);
if (ps) {
- error(errSyntaxWarning, -1, "Substituting font '{0:s}' for '{1:t}'",
- base14SubstFonts[substIdx], name ? name : new GooString("null"));
+ error(errSyntaxWarning, -1, "Substituting font '{0:s}' for '{1:s}'",
+ base14SubstFonts[substIdx], name ? name->getCString() : "null");
fontLoc = new GfxFontLoc();
fontLoc->locType = gfxFontLocResident;
fontLoc->fontType = fontType1;
@@ -777,8 +777,8 @@ GfxFontLoc *GfxFont::locateFont(XRef *xref, GBool ps) {
delete substName;
if (path) {
if ((fontLoc = getExternalFont(path, gFalse))) {
- error(errSyntaxWarning, -1, "Substituting font '{0:s}' for '{1:t}'",
- base14SubstFonts[substIdx], (name == NULL) ? new GooString("") : name);
+ error(errSyntaxWarning, -1, "Substituting font '{0:s}' for '{1:s}'",
+ base14SubstFonts[substIdx], name ? name->getCString() : "");
name = new GooString(base14SubstFonts[substIdx]);
fontLoc->substIdx = substIdx;
return fontLoc;