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

New commits:
commit 9f92feda5eff9b2542c64349f33ae3cf250e7f4b
Author: Thomas Freitag <[email protected]>
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;
   }
 }
_______________________________________________
poppler mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/poppler

Reply via email to