Signed-off-by: Laine Stump <laine(a)redhat.com>
---
src/test/test_driver.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 24ff6e8967..641a141b6a 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -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;
--
2.37.1