mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 21:34:54 +03:00
test driver: replace explicit virNetworkDefFree() with g_autoptr(virNetworkDef)
Signed-off-by: Laine Stump <laine@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
175d8a0852
commit
7f0978843f
@ -5561,7 +5561,7 @@ testNetworkCreateXMLFlags(virConnectPtr conn, const char *xml,
|
||||
unsigned int flags)
|
||||
{
|
||||
testDriver *privconn = conn->privateData;
|
||||
virNetworkDef *newDef;
|
||||
g_autoptr(virNetworkDef) newDef = NULL;
|
||||
virNetworkObj *obj = NULL;
|
||||
virNetworkDef *def;
|
||||
virNetworkPtr net = NULL;
|
||||
@ -5588,7 +5588,6 @@ testNetworkCreateXMLFlags(virConnectPtr conn, const char *xml,
|
||||
net = virGetNetwork(conn, def->name, def->uuid);
|
||||
|
||||
cleanup:
|
||||
virNetworkDefFree(newDef);
|
||||
virObjectEventStateQueue(privconn->eventState, event);
|
||||
virNetworkObjEndAPI(&obj);
|
||||
return net;
|
||||
@ -5608,7 +5607,7 @@ testNetworkDefineXMLFlags(virConnectPtr conn,
|
||||
unsigned int flags)
|
||||
{
|
||||
testDriver *privconn = conn->privateData;
|
||||
virNetworkDef *newDef;
|
||||
g_autoptr(virNetworkDef) newDef = NULL;
|
||||
virNetworkObj *obj = NULL;
|
||||
virNetworkDef *def;
|
||||
virNetworkPtr net = NULL;
|
||||
@ -5632,7 +5631,6 @@ testNetworkDefineXMLFlags(virConnectPtr conn,
|
||||
net = virGetNetwork(conn, def->name, def->uuid);
|
||||
|
||||
cleanup:
|
||||
virNetworkDefFree(newDef);
|
||||
virObjectEventStateQueue(privconn->eventState, event);
|
||||
virNetworkObjEndAPI(&obj);
|
||||
return net;
|
||||
|
Loading…
Reference in New Issue
Block a user