3 Star 0 Fork 0

src-oepkgs/vhostmd

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0014-vhostmd-Fix-memory-leak-in-parse_transports.patch 1.24 KB
一键复制 编辑 原始数据 按行查看 历史
张一诺 提交于 2022-12-23 17:33 . 1.1
From 71a94a18c470ebbd870253b8aedbb7b3b24a274b Mon Sep 17 00:00:00 2001
From: Jim Fehlig <[email protected]>
Date: Tue, 14 Jan 2020 15:08:54 -0700
Subject: [PATCH 14/19] vhostmd: Fix memory leak in parse_transports
From coverity scan
vhostmd-1.1/vhostmd/vhostmd.c:455: alloc_fn: Storage is returned from allocation function "xmlXPathEval".
vhostmd-1.1/vhostmd/vhostmd.c:455: var_assign: Assigning: "obj" = storage returned from "xmlXPathEval((xmlChar *)"//vhostmd/globals/transport", ctxt)".
vhostmd-1.1/vhostmd/vhostmd.c:474: leaked_storage: Variable "obj" going out of scope leaks the storage it points to.
472| #else
473| vu_log (VHOSTMD_ERR, "No support for xenstore transport in this vhostmd");
474|-> return -1;
475| #endif
476| }
Signed-off-by: Jim Fehlig <[email protected]>
---
vhostmd/vhostmd.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/vhostmd/vhostmd.c b/vhostmd/vhostmd.c
index 7374ec9..3d1d53e 100644
--- a/vhostmd/vhostmd.c
+++ b/vhostmd/vhostmd.c
@@ -472,6 +472,7 @@ static int parse_transports(xmlDocPtr xml,
transports |= XENSTORE;
#else
vu_log (VHOSTMD_ERR, "No support for xenstore transport in this vhostmd");
+ xmlXPathFreeObject(obj);
return -1;
#endif
}
--
2.32.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-oepkgs/vhostmd.git
[email protected]:src-oepkgs/vhostmd.git
src-oepkgs
vhostmd
vhostmd
master

搜索帮助