-/* $Id: pazpar2.c,v 1.36 2007-01-16 05:29:48 quinn Exp $ */
+/* $Id: pazpar2.c,v 1.37 2007-01-16 18:44:25 adam Exp $ */
#include <stdlib.h>
#include <stdio.h>
struct record_cluster *cluster;
struct session *se = cl->session;
xmlChar *mergekey, *mergekey_norm;
- xmlChar *type;
- xmlChar *value;
+ xmlChar *type = 0;
+ xmlChar *value = 0;
struct conf_service *service = global_parameters.server->service;
if (!xdoc)
}
relevance_newrec(se->relevance, cluster);
- type = value = 0;
for (n = root->children; n; n = n->next)
{
if (type)
type = xmlGetProp(n, "type");
value = xmlNodeListGetString(xdoc, n->children, 0);
+
+ if (!type || !value)
+ continue;
+
// First, find out what field we're looking at
for (imeta = 0; imeta < service->num_metadata; imeta++)
if (!strcmp(type, service->metadata[imeta].name))
else
yaz_log(YLOG_WARN, "Unexpected element %s in internal record", n->name);
}
+ if (type)
+ xmlFree(type);
+ if (value)
+ xmlFree(value);
xmlFreeDoc(xdoc);