From 48c13bd5203b325deb670d5b69015e9adc40990f Mon Sep 17 00:00:00 2001
From: Nick Wellnhofer <wellnhofer@aevum.de>
Date: Sat, 29 Oct 2022 15:38:16 +0200
Subject: [PATCH 01/28] xinclude: Fix memory leak when fuzzing

This only affects the fuzzing build mode.

Reference: https://github.com/GNOME/libxml2/commit/075cee9e9f1bedb6b2ca87e73a952fb2e92da3c1
Conflict: xinclude.c:<xmlXIncludeDoProcess>
---
 xinclude.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xinclude.c b/xinclude.c
index 8c14a68..6ee58cb 100644
--- a/xinclude.c
+++ b/xinclude.c
@@ -2424,7 +2424,7 @@ xmlXIncludeDoProcess(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr tree,
              * of replacements.
              */
             if (ctxt->incTotal >= 20)
-                return(-1);
+                break;
 #endif
             ctxt->incTotal++;
             xmlXIncludePreProcessNode(ctxt, cur);
-- 
2.27.0

