提交 2669edab 编写于 作者: J John Ferlan

tests: Fix memory leak in mymain

Commit 944a35d7 added @fakerootdir; however, there are multiple
paths out of mymain that didn't free the memory - so just use the
g_autofree to resolve the potential leak.

Found by Coverity
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 d343e820
......@@ -595,7 +595,7 @@ mymain(void)
int ret = 0;
struct qemuHotplugTestData data = {0};
struct testQemuHotplugCpuParams cpudata;
char *fakerootdir;
g_autofree char *fakerootdir = NULL;
fakerootdir = g_strdup(FAKEROOTDIRTEMPLATE);
......@@ -875,7 +875,6 @@ mymain(void)
if (getenv("LIBVIRT_SKIP_CLEANUP") == NULL)
virFileDeleteTree(fakerootdir);
VIR_FREE(fakerootdir);
qemuTestDriverFree(&driver);
virObjectUnref(data.vm);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册