From 197e09d5c537d3bbd6b13f761a445d79c1e23fa7 Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Tue, 2 Jul 2024 19:46:51 +0200 Subject: [PATCH] parser: Fix xmlLoadResource Short-lived regression. --- parserInternals.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/parserInternals.c b/parserInternals.c index 28dad244..4f0c4653 100644 --- a/parserInternals.c +++ b/parserInternals.c @@ -2609,12 +2609,12 @@ xmlLoadResource(xmlParserCtxtPtr ctxt, const char *url, const char *publicId, code = ctxt->resourceLoader(ctxt->resourceCtxt, url, publicId, type, flags, &ret); - if (resource != NULL) - xmlFree(resource); if (code != XML_ERR_OK) { xmlCtxtErrIO(ctxt, code, url); - return(NULL); + ret = NULL; } + if (resource != NULL) + xmlFree(resource); return(ret); }