summaryrefslogtreecommitdiff
authorAlbert Astals Cid <aacid@kde.org>2010-09-21 18:11:42 (GMT)
committer Albert Astals Cid <aacid@kde.org>2010-09-21 18:11:42 (GMT)
commit473de6f88a055bb03470b4af5fa584be8cb5fda4 (patch) (side-by-side diff)
tree202e6c26081a18185942162a967f6c53b2c194da
parent9706e28657ff7ea52aa69d9efb3f91d0cfaee70b (diff)
downloadpoppler-473de6f88a055bb03470b4af5fa584be8cb5fda4.zip
poppler-473de6f88a055bb03470b4af5fa584be8cb5fda4.tar.gz
Fix memory leak if obj2 is not a dict
Found thanks to PDF provided by Joel Voss of Leviathan Security Group
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--poppler/Form.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/poppler/Form.cc b/poppler/Form.cc
index 4df8a7d..21ca672 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