From d16a5818493252b6c26833ecbc007447f23ace4c Mon Sep 17 00:00:00 2001 From: Rhodri James Date: Thu, 27 Jul 2017 11:50:15 +0100 Subject: [PATCH] Remove memory leak in external_entity_optioner() --- expat/tests/runtests.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c index 669b665d..51930cb0 100644 --- a/expat/tests/runtests.c +++ b/expat/tests/runtests.c @@ -339,16 +339,16 @@ external_entity_optioner(XML_Parser parser, while (options->parse_text != NULL) { if (!strcmp(systemId, options->system_id)) { + enum XML_Status rc; ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL); if (ext_parser == NULL) return XML_STATUS_ERROR; - if (_XML_Parse_SINGLE_BYTES(ext_parser, options->parse_text, - strlen(options->parse_text), - XML_TRUE) == XML_STATUS_ERROR) - return XML_STATUS_ERROR; + rc = _XML_Parse_SINGLE_BYTES(ext_parser, options->parse_text, + strlen(options->parse_text), + XML_TRUE); XML_ParserFree(ext_parser); - return XML_STATUS_OK; + return rc; } options++; }