mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
tests: bhyve: use g_autoptr where possible
Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Laine Stump <laine@redhat.com> Reviewed-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
This commit is contained in:
parent
a7d3d925a7
commit
aeb5951aa4
@ -32,7 +32,7 @@ testCompareXMLToArgvFiles(const char *xmlfile,
|
||||
g_autofree char *cmd = NULL;
|
||||
g_autofree char *log = NULL;
|
||||
int ret = -1;
|
||||
virDomainDefPtr vmdef = NULL;
|
||||
g_autoptr(virDomainDef) vmdef = NULL;
|
||||
|
||||
if (virTestLoadFile(cmdfile, &cmd) < 0)
|
||||
goto fail;
|
||||
@ -86,7 +86,6 @@ testCompareXMLToArgvFiles(const char *xmlfile,
|
||||
ret = 0;
|
||||
|
||||
fail:
|
||||
virDomainDefFree(vmdef);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -29,10 +29,10 @@ static int testCompareXMLToArgvFiles(const char *xml,
|
||||
g_autofree char *actualargv = NULL;
|
||||
g_autofree char *actualld = NULL;
|
||||
g_autofree char *actualdm = NULL;
|
||||
virDomainDefPtr vmdef = NULL;
|
||||
virCommandPtr cmd = NULL;
|
||||
virCommandPtr ldcmd = NULL;
|
||||
virConnectPtr conn;
|
||||
g_autoptr(virDomainDef) vmdef = NULL;
|
||||
g_autoptr(virCommand) cmd = NULL;
|
||||
g_autoptr(virCommand) ldcmd = NULL;
|
||||
g_autoptr(virConnect) conn = NULL;
|
||||
int ret = -1;
|
||||
|
||||
if (!(conn = virGetConnect()))
|
||||
@ -99,10 +99,6 @@ static int testCompareXMLToArgvFiles(const char *xml,
|
||||
vmdef->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC)
|
||||
virPortAllocatorRelease(vmdef->graphics[0]->data.vnc.port);
|
||||
|
||||
virCommandFree(cmd);
|
||||
virCommandFree(ldcmd);
|
||||
virDomainDefFree(vmdef);
|
||||
virObjectUnref(conn);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user