In case of an error do the cleanup of the private data of the
connection.
Signed-off-by: Marc Hartmayer <mhartmay(a)linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy(a)linux.vnet.ibm.com>
---
src/test/test_driver.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index fca607f57d51..3b55453efe00 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -1493,8 +1493,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;
}
--
2.13.4