[poppler] Memory leak fix, correct or not?

Albert Astals Cid aacid at kde.org
Sat Oct 4 11:29:31 PDT 2008


Hi all, the attached code fixes a leak for me, but i'm not sure it's correct, 
i tested a bit and could not see any regression, but i'm not sure either what 
this code is supposed to do, besides modifying the AP :D

Iñigo i think the code is yours, could you have a look? And tell if it's ok?

Albert

diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index 6e35b2a..481b43d 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -3066,8 +3066,8 @@ void AnnotWidget::generateFieldAppearance() {
     oaRef.initRef(appRef.num, appRef.gen);
 
     apObj.dictSet("N", &oaRef);
-    annot->set("AP", &apObj);
     Dict* d = new Dict(annot);
+    d->set("AP", &apObj);
     d->decRef();
     Object dictObj;
     dictObj.initDict(d);


More information about the poppler mailing list