Use Odr_int type for hit counts
[pazpar2-moved-to-github.git] / 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;
        }
     }