• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1From cfbc1f48ee6259efaedcdc485d86b90e252da970 Mon Sep 17 00:00:00 2001
2From: Nick Wellnhofer <wellnhofer@aevum.de>
3Date: Sun, 5 Mar 2023 14:06:51 +0100
4Subject: [PATCH] malloc-fail: Fix memory leak in xmlSchemaParse
5
6Found with libFuzzer, see #344.
7
8Reference:https://github.com/GNOME/libxml2/commit/cfbc1f48ee6259efaedcdc485d86b90e252da970
9Conflict:NA
10---
11 xmlschemas.c | 2 +-
12 1 file changed, 1 insertion(+), 1 deletion(-)
13
14diff --git a/xmlschemas.c b/xmlschemas.c
15index c68103c..fa9d113 100644
16--- a/xmlschemas.c
17+++ b/xmlschemas.c
18@@ -21473,7 +21473,7 @@ xmlSchemaParse(xmlSchemaParserCtxtPtr ctxt)
19     if (ctxt->constructor == NULL) {
20 	ctxt->constructor = xmlSchemaConstructionCtxtCreate(ctxt->dict);
21 	if (ctxt->constructor == NULL)
22-	    return(NULL);
23+	    goto exit_failure;
24 	/* Take ownership of the constructor to be able to free it. */
25 	ctxt->ownsConstructor = 1;
26     }
27--
282.27.0
29
30