aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Popov <arrowd@FreeBSD.org>2026-04-08 08:21:38 +0000
committerGleb Popov <arrowd@FreeBSD.org>2026-04-08 08:22:34 +0000
commitbef6f87fa11d50c200bd4768e0267648fd3660fb (patch)
tree1f972a89603378f8b1bac2a52f363af079c6cb87
parenta7691f104e94a997b8ec6e651379144c4aabe955 (diff)
textproc/libxml2: Plug a memory leak with a patch from upstream
PR: 294260 Reported by: diizzy
-rw-r--r--textproc/libxml2/Makefile1
-rw-r--r--textproc/libxml2/files/patch-catalog-memleak28
2 files changed, 29 insertions, 0 deletions
diff --git a/textproc/libxml2/Makefile b/textproc/libxml2/Makefile
index b1be06d89e24..66f1b6b629af 100644
--- a/textproc/libxml2/Makefile
+++ b/textproc/libxml2/Makefile
@@ -1,5 +1,6 @@
PORTNAME?= libxml2
DISTVERSION= 2.15.2
+PORTREVISION= 1
CATEGORIES?= textproc gnome
MASTER_SITES= GNOME
DISTNAME= libxml2-${DISTVERSION}
diff --git a/textproc/libxml2/files/patch-catalog-memleak b/textproc/libxml2/files/patch-catalog-memleak
new file mode 100644
index 000000000000..3f45fcc0e3c6
--- /dev/null
+++ b/textproc/libxml2/files/patch-catalog-memleak
@@ -0,0 +1,28 @@
+From fac4411aa65a2ebf936be50856ab14c148966e9d Mon Sep 17 00:00:00 2001
+From: "Jan Alexander Steffens (heftig)" <heftig@archlinux.org>
+Date: Wed, 4 Mar 2026 19:08:16 +0100
+Subject: [PATCH] catalog: Free xmlCatalogResolveCache on cleanup
+
+Otherwise the `tstLastError.py` test will complain about a memory leak.
+
+Fixes: b706c5c5b7ce11d002a5b77ff938aa3693931c12 (Add xmlCatalogResolveCache)
+Fixes: https://gitlab.gnome.org/GNOME/libxml2/-/issues/1069
+---
+ catalog.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git catalog.c catalog.c
+index 263268c08..ff97adedf 100644
+--- catalog.c
++++ catalog.c
+@@ -3338,6 +3338,7 @@ xmlCatalogCleanup(void) {
+ if (xmlDebugCatalogs)
+ xmlCatalogPrintDebug(
+ "Catalogs cleanup\n");
++ xmlResetCatalogResolveCache();
+ if (xmlCatalogXMLFiles != NULL)
+ xmlHashFree(xmlCatalogXMLFiles, xmlFreeCatalogHashEntryList);
+ xmlCatalogXMLFiles = NULL;
+--
+GitLab
+