1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-05 13:17:51 +03:00

test: fix error path in testConnectOpen

In case of an error do the cleanup of the private data of the
connection.

Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
Marc Hartmayer 2018-03-08 13:20:35 +01:00 committed by John Ferlan
parent bc0f82adf8
commit 1ee9c384da

View File

@ -1483,8 +1483,11 @@ testConnectOpen(virConnectPtr conn,
return ret;
/* Fake authentication. */
if (testConnectAuthenticate(conn, auth) < 0)
if (testConnectAuthenticate(conn, auth) < 0) {
testDriverCloseInternal(conn->privateData);
conn->privateData = NULL;
return VIR_DRV_OPEN_ERROR;
}
return VIR_DRV_OPEN_SUCCESS;
}