Fix double xmlFree - occurred for XSLT failure
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 20 Oct 2009 10:02:57 +0000 (12:02 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 20 Oct 2009 10:02:57 +0000 (12:02 +0200)
src/normalize_record.c

index 322566e..dfca8bb 100644 (file)
@@ -137,17 +137,17 @@ int normalize_record_transform(normalize_record_t nt, xmlDoc **doc,
            {
                new = marcmap_apply(m->marcmap, *doc);
            }
-           
+
            root = xmlDocGetRootElement(new);
            
+           xmlFreeDoc(*doc);
            if (!new || !root || !root->children)
            {
                if (new)
                    xmlFreeDoc(new);
-               xmlFreeDoc(*doc);
+                *doc = 0;
                return -1;
            }
-           xmlFreeDoc(*doc);
            *doc = new;
        }
     }