• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1From cb4334b7abf265f55d1a41f435fedd67494eeb18 Mon Sep 17 00:00:00 2001
2From: Nick Wellnhofer <wellnhofer@aevum.de>
3Date: Tue, 14 Feb 2023 18:10:14 +0100
4Subject: [PATCH] malloc-fail: Fix memory leak in xmlSAX2StartElementNs
5
6Found with libFuzzer, see #344.
7
8Reference:https://github.com/GNOME/libxml2/commit/cb4334b7abf265f55d1a41f435fedd67494eeb18
9Conflict:NA
10---
11 SAX2.c | 1 +
12 1 file changed, 1 insertion(+)
13
14diff --git a/SAX2.c b/SAX2.c
15index 2426e93..916e974 100644
16--- a/SAX2.c
17+++ b/SAX2.c
18@@ -2242,6 +2242,7 @@ xmlSAX2StartElementNs(void *ctx,
19 	        ret->name = lname;
20 	    if (ret->name == NULL) {
21 	        xmlSAX2ErrMemory(ctxt, "xmlSAX2StartElementNs");
22+                xmlFree(ret);
23 		return;
24 	    }
25 	}
26--
272.27.0
28
29