1From f3e62035d8b80a6dba92639f2470f02258822a0a Mon Sep 17 00:00:00 2001 2From: Nick Wellnhofer <wellnhofer@aevum.de> 3Date: Thu, 16 Feb 2023 14:49:06 +0100 4Subject: [PATCH] malloc-fail: Fix memory leak in htmlCreatePushParserCtxt 5 6Found with libFuzzer, see #344. 7 8Reference:https://github.com/GNOME/libxml2/commit/f3e62035d8b80a6dba92639f2470f02258822a0a 9Conflict:NA 10--- 11 HTMLparser.c | 2 +- 12 1 file changed, 1 insertion(+), 1 deletion(-) 13 14diff --git a/HTMLparser.c b/HTMLparser.c 15index 7ea2e62..5272c25 100644 16--- a/HTMLparser.c 17+++ b/HTMLparser.c 18@@ -6355,7 +6355,7 @@ htmlCreatePushParserCtxt(htmlSAXHandlerPtr sax, void *user_data, 19 inputStream = htmlNewInputStream(ctxt); 20 if (inputStream == NULL) { 21 xmlFreeParserCtxt(ctxt); 22- xmlFree(buf); 23+ xmlFreeParserInputBuffer(buf); 24 return(NULL); 25 } 26 27-- 282.27.0 29