加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
backport-xmllint-Fix-memory-leak-with-pattern-stream.patch 1.07 KB
一键复制 编辑 原始数据 按行查看 历史
冉召宇 提交于 2024-04-25 19:13 . libxml2切openEuler7.0
From 64b76f8163d3608f9881b4de23dcc06530ba9323 Mon Sep 17 00:00:00 2001
From: Nick Wellnhofer <wellnhofer@aevum.de>
Date: Tue, 14 Mar 2023 13:17:20 +0100
Subject: [PATCH] xmllint: Fix memory leak with --pattern --stream
Fixes #499.
Reference:https://github.com/GNOME/libxml2/commit/64b76f8163d3608f9881b4de23dcc06530ba9323
Conflict:NA
---
xmllint.c | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/xmllint.c b/xmllint.c
index ee6bfdc..c79b8e9 100644
--- a/xmllint.c
+++ b/xmllint.c
@@ -1848,15 +1848,6 @@ static void streamFile(char *filename) {
#endif
reader = xmlReaderForFile(filename, NULL, options);
#ifdef LIBXML_PATTERN_ENABLED
- if (pattern != NULL) {
- patternc = xmlPatterncompile((const xmlChar *) pattern, NULL, 0, NULL);
- if (patternc == NULL) {
- xmlGenericError(xmlGenericErrorContext,
- "Pattern %s failed to compile\n", pattern);
- progresult = XMLLINT_ERR_SCHEMAPAT;
- pattern = NULL;
- }
- }
if (patternc != NULL) {
patstream = xmlPatternGetStreamCtxt(patternc);
if (patstream != NULL) {
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化