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:25:37 +0100
commit2fa6e106d5123aad63f6c0a5c61dd457b14ef851 (patch)
treea728b16dbc15517075ee7f4a3faae8522508dfb6
parent37525c8aa37f1b0b2e06702030956edd81c76798 (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