[poppler] poppler/CharCodeToUnicode.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Fri Nov 2 15:06:36 PDT 2012


 poppler/CharCodeToUnicode.cc |    2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 9f92feda5eff9b2542c64349f33ae3cf250e7f4b
Author: Thomas Freitag <Thomas.Freitag at alfa.de>
Date:   Fri Nov 2 23:05:55 2012 +0100

    Memory leak in CharCodeToUnicode
    
    Bug #54702

diff --git a/poppler/CharCodeToUnicode.cc b/poppler/CharCodeToUnicode.cc
index 4298090..ed59395 100644
--- a/poppler/CharCodeToUnicode.cc
+++ b/poppler/CharCodeToUnicode.cc
@@ -459,12 +459,14 @@ void CharCodeToUnicode::addMapping(CharCode code, char *uStr, int n,
     Unicode *utf16 = (Unicode*)gmallocn(utf16Len, sizeof(Unicode));
     for (j = 0; j < utf16Len; ++j) {
       if (!parseHex(uStr + j*4, 4, &utf16[j])) {
+	gfree(utf16);
 	error(errSyntaxWarning, -1, "Illegal entry in ToUnicode CMap");
 	return;
       }
     }
     utf16[utf16Len - 1] += offset;
     sMap[sMapLen].len = UTF16toUCS4(utf16, utf16Len, &sMap[sMapLen].u);
+    gfree(utf16);
     ++sMapLen;
   }
 }


More information about the poppler mailing list