summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2010-09-21 19:11:42 +0100
committerAlbert Astals Cid <aacid@kde.org>2010-09-21 19:11:42 +0100
commit473de6f88a055bb03470b4af5fa584be8cb5fda4 (patch)
tree202e6c26081a18185942162a967f6c53b2c194da
parent9706e28657ff7ea52aa69d9efb3f91d0cfaee70b (diff)
Fix memory leak if obj2 is not a dict
Found thanks to PDF provided by Joel Voss of Leviathan Security Group
-rw-r--r--poppler/Form.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/poppler/Form.cc b/poppler/Form.cc
index 4df8a7d0..21ca672d 100644
--- a/poppler/Form.cc
+++ b/poppler/Form.cc
@@ -715,13 +715,14 @@ FormField::FormField(XRef* xrefA, Object *aobj, const Ref& aref, FormFieldType t
// Load children
for(int i=0; i<length; i++) {
Object obj2,obj3;
- Object childRef;
array->get(i, &obj2);
- array->getNF(i, &childRef);
if (!obj2.isDict ()) {
error (-1, "Reference to an invalid or non existant object");
+ obj2.free();
continue;
}
+ Object childRef;
+ array->getNF(i, &childRef);
//field child
if (dict->lookup ("FT", &obj3)->isName()) {
// If I'm not a generic container field and my children