1 Star 0 Fork 71

tzr/libvirt

forked from src-openEuler/libvirt 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
admin-fix-leak-of-typed-parameters-on-error.patch 1.96 KB
一键复制 编辑 原始数据 按行查看 历史
Jiabo Feng 提交于 2023-11-29 15:42 . libvirt update to version 6.2.0-60
From 90b8168fd93490f3a0fadadb38030163712a0e85 Mon Sep 17 00:00:00 2001
From: wangmeiyang <wangmeiyang@xfusion.com>
Date: Fri, 21 Apr 2023 14:43:45 +0800
Subject: [PATCH] admin: fix leak of typed parameters on error
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
A few admin client methods had the xdr_free call the wrong
side of the cleanup label, so typed parameters would not
be freed on error.
origin commit: https://gitlab.com/libvirt/libvirt/-/commit/0edf44664e9f2f75c7ba5faab91e2e190b5626af
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Meiyang Wang <wangmeiyang@xfusion.com>
---
src/admin/admin_remote.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/admin/admin_remote.c b/src/admin/admin_remote.c
index ca5e0c9fe4..2499fb8b0f 100644
--- a/src/admin/admin_remote.c
+++ b/src/admin/admin_remote.c
@@ -271,9 +271,9 @@ remoteAdminServerGetThreadPoolParameters(virAdmServerPtr srv,
goto cleanup;
rv = 0;
- xdr_free((xdrproc_t)xdr_admin_server_get_threadpool_parameters_ret, (char *) &ret);
cleanup:
+ xdr_free((xdrproc_t)xdr_admin_server_get_threadpool_parameters_ret, (char *) &ret);
virObjectUnlock(priv);
return rv;
}
@@ -344,9 +344,9 @@ remoteAdminClientGetInfo(virAdmClientPtr client,
goto cleanup;
rv = 0;
- xdr_free((xdrproc_t)xdr_admin_client_get_info_ret, (char *) &ret);
cleanup:
+ xdr_free((xdrproc_t)xdr_admin_client_get_info_ret, (char *) &ret);
virObjectUnlock(priv);
return rv;
}
@@ -382,10 +382,10 @@ remoteAdminServerGetClientLimits(virAdmServerPtr srv,
goto cleanup;
rv = 0;
- xdr_free((xdrproc_t) xdr_admin_server_get_client_limits_ret,
- (char *) &ret);
cleanup:
+ xdr_free((xdrproc_t) xdr_admin_server_get_client_limits_ret,
+ (char *) &ret);
virObjectUnlock(priv);
return rv;
}
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tom0392/libvirt.git
git@gitee.com:tom0392/libvirt.git
tom0392
libvirt
libvirt
master

搜索帮助