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>
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;
}