summaryrefslogtreecommitdiff
path: root/libpiano/src
diff options
context:
space:
mode:
Diffstat (limited to 'libpiano/src')
-rw-r--r--libpiano/src/xml.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libpiano/src/xml.c b/libpiano/src/xml.c
index d0faca6..33c2dde 100644
--- a/libpiano/src/xml.c
+++ b/libpiano/src/xml.c
@@ -146,7 +146,7 @@ void PianoXmlStructParser (xmlNode *structRoot,
* @param xml document
* @param returns document pointer (needed to free memory later)
* @param returns document root
- * @return _RET_ERR or _RET_OK
+ * @return _OK or error
*/
PianoReturn_t PianoXmlInitDoc (char *xml, xmlDocPtr *doc, xmlNode **docRoot) {
*doc = xmlReadDoc ((xmlChar *) xml, NULL, NULL, 0);
@@ -160,6 +160,7 @@ PianoReturn_t PianoXmlInitDoc (char *xml, xmlDocPtr *doc, xmlNode **docRoot) {
*docRoot = xmlDocGetRootElement (*doc);
if ((ret = PianoXmlIsFault (*docRoot)) != PIANO_RET_OK) {
+ xmlFreeDoc (*doc);
return ret;
}