• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1From 3b59fdf001f030e1b2180d3303347119e05d8dcb Mon Sep 17 00:00:00 2001
2From: Nick Wellnhofer <wellnhofer@aevum.de>
3Date: Wed, 15 Feb 2023 13:28:24 +0100
4Subject: [PATCH] malloc-fail: Fix memory leak in xmlXIncludeAddNode
5
6Found with libFuzzer, see #344.
7
8Reference:https://github.com/GNOME/libxml2/commit/3b59fdf001f030e1b2180d3303347119e05d8dcb
9Conflict:xinclude.c
10
11---
12 xinclude.c | 1 +
13 1 file changed, 1 insertion(+)
14
15diff --git a/xinclude.c b/xinclude.c
16index 6e5b61d..cc22848 100644
17--- a/xinclude.c
18+++ b/xinclude.c
19@@ -660,6 +660,7 @@ xmlXIncludeAddNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr cur) {
20     ref = xmlXIncludeNewRef(ctxt, URL, cur);
21     xmlFree(URL);
22     if (ref == NULL) {
23+        xmlFree(fragment);
24 	return(-1);
25     }
26     ref->fragment = fragment;
27--
282.27.0
29
30