libxml2/backport-valid-Allow-xmlFreeValidCtxt-NULL.patch
zhuofeng feb7e8218d backport upstream patches
(cherry picked from commit ec64ed27a9add0f7a9bf6ee351ad67302a60c383)
2023-06-20 11:16:46 +08:00

30 lines
716 B
Diff

From a57a7549fabfb7112510a2ee80a874e988200c32 Mon Sep 17 00:00:00 2001
From: Nick Wellnhofer <wellnhofer@aevum.de>
Date: Sun, 12 Mar 2023 16:06:19 +0100
Subject: [PATCH] valid: Allow xmlFreeValidCtxt(NULL)
Reference:https://github.com/GNOME/libxml2/commit/a57a7549fabfb7112510a2ee80a874e988200c32
Conflict:NA
---
valid.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/valid.c b/valid.c
index b7b92fe..9a2c708 100644
--- a/valid.c
+++ b/valid.c
@@ -899,6 +899,8 @@ xmlValidCtxtPtr xmlNewValidCtxt(void) {
*/
void
xmlFreeValidCtxt(xmlValidCtxtPtr cur) {
+ if (cur == NULL)
+ return;
if (cur->vstateTab != NULL)
xmlFree(cur->vstateTab);
if (cur->nodeTab != NULL)
--
2.27.0