1 Star 0 Fork 71

lIshaohui/libvirt

forked from src-openEuler/libvirt 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
parthelper-Initialize-error-object.patch 1.27 KB
一键复制 编辑 原始数据 按行查看 历史
From 164e4821d0333812b32f9ce9e64133df31dd6443 Mon Sep 17 00:00:00 2001
From: Michal Privoznik <mprivozn@redhat.com>
Date: Thu, 22 Oct 2020 12:49:44 +0200
Subject: [PATCH 070/108] parthelper: Initialize error object
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Some functions called from parthelper can report an error. But
that means that the error object must be initialized otherwise
virResetError() (which happens as a part of virReportError())
will free random pointers.
Reported-by: Katerina Koukiou <kkoukiou@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
(cherry picked from commit 3b8deb9603fb2a393a28fe4750aba91626619305)
---
src/storage/parthelper.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/storage/parthelper.c b/src/storage/parthelper.c
index 8278ddf31e..caa2e8fa62 100644
--- a/src/storage/parthelper.c
+++ b/src/storage/parthelper.c
@@ -66,7 +66,8 @@ int main(int argc, char **argv)
const char *partsep;
bool devmap_partsep = false;
- if (virGettextInitialize() < 0)
+ if (virGettextInitialize() < 0 ||
+ virErrorInitialize() < 0)
exit(EXIT_FAILURE);
if (argc == 3 && STREQ(argv[2], "-g")) {
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/li-shaohui/libvirt.git
git@gitee.com:li-shaohui/libvirt.git
li-shaohui
libvirt
libvirt
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385