parser xml BUGFIX memory leak
diff --git a/src/parser_xml.c b/src/parser_xml.c
index fc7f3d8..3ce2611 100644
--- a/src/parser_xml.c
+++ b/src/parser_xml.c
@@ -723,7 +723,7 @@
             LY_CHECK_ERR_GOTO(!val, LOGMEM(xmlctx->ctx); ret = LY_EMEM, error);
 
             /* parser next */
-            LY_CHECK_GOTO(ret = lyxml_ctx_next(xmlctx), error);
+            LY_CHECK_ERR_GOTO(ret = lyxml_ctx_next(xmlctx), free(val), error);
 
             /* create node */
             ret = lyd_create_any(snode, val, LYD_ANYDATA_STRING, 1, &node);