代码拉取完成,页面将自动刷新
同步操作将从 OpenHarmony/third_party_libxml2 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From a09c89545d3ed5b56701abcc5d638faa01c5c903 Mon Sep 17 00:00:00 2001
From: Nick Wellnhofer <wellnhofer@aevum.de>
Date: Mon, 15 Aug 2022 12:19:25 +0200
Subject: [PATCH] Fix memory leak with invalid XSD
xmlSchemaClearElemInfo can add new items to the "matcher" cache, so the
cache must be cleared after calling this function, not before. This
only seems to affect invalid XSDs.
Fixes #390.
Reference:https://github.com/GNOME/libxml2/commit/a09c89545d3ed5b56701abcc5d638faa01c5c903
Conflict:NA
---
xmlschemas.c | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/xmlschemas.c b/xmlschemas.c
index 9da4cd1..9aa6acf 100644
--- a/xmlschemas.c
+++ b/xmlschemas.c
@@ -27830,17 +27830,6 @@ xmlSchemaClearValidCtxt(xmlSchemaValidCtxtPtr vctxt)
} while (cur != NULL);
vctxt->aidcs = NULL;
}
- if (vctxt->idcMatcherCache != NULL) {
- xmlSchemaIDCMatcherPtr matcher = vctxt->idcMatcherCache, tmp;
-
- while (matcher) {
- tmp = matcher;
- matcher = matcher->nextCached;
- xmlSchemaIDCFreeMatcherList(tmp);
- }
- vctxt->idcMatcherCache = NULL;
- }
-
if (vctxt->idcNodes != NULL) {
int i;
@@ -27907,6 +27896,21 @@ xmlSchemaClearValidCtxt(xmlSchemaValidCtxtPtr vctxt)
xmlFree(vctxt->filename);
vctxt->filename = NULL;
}
+
+ /*
+ * Note that some cleanup functions can move items to the cache,
+ * so the cache shouldn't be freed too early.
+ */
+ if (vctxt->idcMatcherCache != NULL) {
+ xmlSchemaIDCMatcherPtr matcher = vctxt->idcMatcherCache, tmp;
+
+ while (matcher) {
+ tmp = matcher;
+ matcher = matcher->nextCached;
+ xmlSchemaIDCFreeMatcherList(tmp);
+ }
+ vctxt->idcMatcherCache = NULL;
+ }
}
/**
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。