From b47dbc9745932c160893d433220e462bd605f8cd Mon Sep 17 00:00:00 2001 From: Rhodri James Date: Tue, 11 Apr 2017 12:44:25 +0100 Subject: [PATCH] Tidy up attribute prefix bindings on error (fixes #17) --- expat/lib/xmlparse.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c index bcd7306f..2509652f 100644 --- a/expat/lib/xmlparse.c +++ b/expat/lib/xmlparse.c @@ -2529,8 +2529,10 @@ doContent(XML_Parser parser, return XML_ERROR_NO_MEMORY; poolFinish(&tempPool); result = storeAtts(parser, enc, s, &name, &bindings); - if (result) + if (result != XML_ERROR_NONE) { + freeBindings(parser, bindings); return result; + } poolFinish(&tempPool); if (startElementHandler) { startElementHandler(handlerArg, name.str, (const XML_Char **)atts);