From f05461c79b402d35bb6ca5feb75a848f4a5a3c7d Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 27 Sep 2013 13:47:20 +0200 Subject: [PATCH] yaz-marcdump: fix leaks for MARCXML parsing YAZ-694 --- util/marcdump.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/util/marcdump.c b/util/marcdump.c index f92204e..891174b 100644 --- a/util/marcdump.c +++ b/util/marcdump.c @@ -133,8 +133,7 @@ static void marcdump_read_xml(yaz_marc_t mt, const char *fname) int type = xmlTextReaderNodeType(reader); if (type == XML_READER_TYPE_ELEMENT) { - const char *name = (const char *) - xmlTextReaderLocalName(reader); + char *name = (char *) xmlTextReaderLocalName(reader); if (!strcmp(name, "record") || !strcmp(name, "r")) { xmlNodePtr ptr = xmlTextReaderExpand(reader); @@ -158,8 +157,10 @@ static void marcdump_read_xml(yaz_marc_t mt, const char *fname) wrbuf_rewind(wrbuf); } } + xmlFree(name); } } + xmlFreeTextReader(reader); } #else xmlDocPtr doc = xmlParseFile(fname); -- 1.7.10.4