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);