代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/libvirt 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From e210025037fbd00c81e8faa0a5339dccdc0c75a1 Mon Sep 17 00:00:00 2001
From: wangmeiyang <wangmeiyang_yewu@cmss.chinamobile.com>
Date: Thu, 24 Nov 2022 09:10:25 +0800
Subject: [PATCH 12/23] vshtabletest: Fix potential memleak
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
In testVshTableNew() we test whether vshTableNew(NULL) allocates
a table. This is expected to fail (and return NULL), because
passing nothing but NULL to vshTableNew() is viewed as error.
Nevertheless, if vshTableNew() did not fail and returned an
allocated table it would be leaked.
cherry-pick from eb9bbde7721af765d88086dc3055cff092436c58
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Meiyang Wang <wangmeiyang_yewu@cmss.chinamobile.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
tests/vshtabletest.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tests/vshtabletest.c b/tests/vshtabletest.c
index 15369d8eb2..348f525234 100644
--- a/tests/vshtabletest.c
+++ b/tests/vshtabletest.c
@@ -33,11 +33,12 @@
static int
testVshTableNew(const void *opaque G_GNUC_UNUSED)
{
- if (vshTableNew(NULL)) {
+ vshTablePtr table = vshTableNew(NULL);
+ if (table) {
fprintf(stderr, "expected failure when passing null to vshTableNew\n");
return -1;
}
-
+ vshTableFree(table);
return 0;
}
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。