From e16309327f36c5e29217fa869fe1b2cdb466d7de Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 11 Sep 2015 21:11:52 +0200 Subject: [PATCH] Fix leak in record parsing Occurred when empty data was produced and metadata did not have the attribute "empty". The empty attribute was introduced in PAZ-858. --- src/session.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/session.c b/src/session.c index 49425d5..33cfc39 100644 --- a/src/session.c +++ b/src/session.c @@ -2190,6 +2190,8 @@ static int ingest_to_cluster(struct client *cl, if (!value0 || !*value0) { const char *empty = yaz_xml_get_prop(n, "empty"); + if (value0) + xmlFree(value0); if (!empty) continue; wrbuf_puts(wrbuf_disp, (const char *) empty); @@ -2197,9 +2199,8 @@ static int ingest_to_cluster(struct client *cl, else { wrbuf_puts(wrbuf_disp, (const char *) value0); - } - if (value0) xmlFree(value0); + } ser_md = &service->metadata[md_field_id]; // non-merged metadata -- 1.7.10.4