projects
/
yaz-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a455867
)
yaz-marcdump: fix leaks for MARCXML parsing YAZ-694
author
Adam Dickmeiss
<adam@indexdata.dk>
Fri, 27 Sep 2013 11:47:20 +0000
(13:47 +0200)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Fri, 27 Sep 2013 11:47:20 +0000
(13:47 +0200)
util/marcdump.c
patch
|
blob
|
history
diff --git
a/util/marcdump.c
b/util/marcdump.c
index
f92204e
..
891174b
100644
(file)
--- 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);