[poppler] goo/GooString.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Wed Nov 9 03:44:33 PST 2011


 goo/GooString.cc |    3 +++
 1 file changed, 3 insertions(+)

New commits:
commit e7dbd17ff07afa465636a90f526cd7ac8c731862
Author: Kenji Uno <ku at digitaldolphins.jp>
Date:   Wed Nov 9 12:39:41 2011 +0100

    Fix leak in GooString when resizing
    
    If resizing from "long" to shorter

diff --git a/goo/GooString.cc b/goo/GooString.cc
index a96b792..31c95b1 100644
--- a/goo/GooString.cc
+++ b/goo/GooString.cc
@@ -19,6 +19,7 @@
 // Copyright (C) 2006 Krzysztof Kowalczyk <kkowalczyk at gmail.com>
 // Copyright (C) 2007 Jeff Muizelaar <jeff at infidigm.net>
 // Copyright (C) 2008-2011 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2011 Kenji Uno <ku at digitaldolphins.jp>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -129,6 +130,8 @@ void inline GooString::resize(int newLength) {
       } else {
 	memcpy(s1, s, length);
       }
+      if (s != sStatic)
+	gfree(s);
     }
 
   }


More information about the poppler mailing list