[poppler] poppler/Annot.cc poppler/Form.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Sun Jan 4 05:04:19 PST 2009


 poppler/Annot.cc |    5 ++++-
 poppler/Form.cc  |    4 +++-
 2 files changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 5203aefc41fa47c461812cc46f28281edd226515
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sun Jan 4 14:03:16 2009 +0100

    Plug some memory leaks

diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index 2510763..7c01d7b 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -15,7 +15,7 @@
 //
 // Copyright (C) 2006 Scott Turner <scotty1024 at mac.com>
 // Copyright (C) 2007, 2008 Julien Rebetez <julienr at svn.gnome.org>
-// Copyright (C) 2007, 2008 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2007-2009 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2007, 2008 Carlos Garcia Campos <carlosgc at gnome.org>
 // Copyright (C) 2007, 2008 Iñigo Martínez <inigomartinez at gmail.com>
 // Copyright (C) 2007 Jeff Muizelaar <jeff at infidigm.net>
@@ -3057,6 +3057,9 @@ void AnnotWidget::generateFieldAppearance() {
       appRef = obj2.getRef();
     }
 
+    obj2.free();
+    obj1.free();
+
     // this annot doesn't have an AP yet, create one
     if (appRef.num == 0)
       appRef = xref->addIndirectObject(&appearance);
diff --git a/poppler/Form.cc b/poppler/Form.cc
index fb9ab89..dad706e 100644
--- a/poppler/Form.cc
+++ b/poppler/Form.cc
@@ -5,7 +5,7 @@
 // This file is licensed under the GPLv2 or later
 //
 // Copyright 2006-2008 Julien Rebetez <julienr at svn.gnome.org>
-// Copyright 2007-2008 Albert Astals Cid <aacid at kde.org>
+// Copyright 2007-2009 Albert Astals Cid <aacid at kde.org>
 // Copyright 2007-2008 Carlos Garcia Campos <carlosgc at gnome.org>
 // Copyright 2007 Adrian Johnson <ajohnson at redneon.com>
 // Copyright 2007 Iñigo Martínez <inigomartinez at gmail.com>
@@ -258,11 +258,13 @@ void FormWidgetButton::loadDefaults ()
 	      break;
           }
         } else if (obj2.isStream()) {
+          // TODO do something with str and obj3
           Stream *str = obj2.getStream();
           Dict *tmpDict2 = str->getDict();
           Object obj3;
           tmpDict2->lookup("Length", &obj3);
           onStr = new GooString ("D");
+          obj3.free();
         }
         obj2.free();
 	if (onStr)


More information about the poppler mailing list