From 6783b8af64ba46b71607be62ae37db6e8a3a2b2e Mon Sep 17 00:00:00 2001 From: tkummermehr Date: Fri, 14 Jul 2017 11:32:51 +0200 Subject: Fixed segmentation fault on faulty XML --- ucs2-interface/ucs-xml/UcsXml.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ucs2-interface') diff --git a/ucs2-interface/ucs-xml/UcsXml.c b/ucs2-interface/ucs-xml/UcsXml.c index 96498ef..f953fe3 100644 --- a/ucs2-interface/ucs-xml/UcsXml.c +++ b/ucs2-interface/ucs-xml/UcsXml.c @@ -266,7 +266,7 @@ static ParseResult_t ParseRoutes(UcsXmlVal_t *ucs, PrivateData_t *priv); UcsXmlVal_t *UcsXml_Parse(const char *xmlString) { - UcsXmlVal_t *val; + UcsXmlVal_t *val = NULL; ParseResult_t result = Parse_MemoryError; mxml_node_t *tree; if (!(tree = mxmlLoadString(NULL, xmlString, MXML_NO_CALLBACK))) goto ERROR; @@ -287,7 +287,8 @@ ERROR: assert(false); if (!tree) mxmlDelete(tree); - FreeVal(val); + if (val) + FreeVal(val); return NULL; } -- cgit 1.2.3-korg