mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-20 18:03:50 +03:00
test: testConnectClose: Set privateData to NULL in all cases
Set privateData to NULL also for a connection that uses @defaultConn as privateData regardless of whether @defaultConn was freed or not. @defaultConn is shared between multiple connections and it's ensured that there will be no memory leak by counting references. 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:
parent
5428389b2b
commit
81b2a8e024
@ -1472,6 +1472,7 @@ static int testConnectClose(virConnectPtr conn)
|
||||
dflt = true;
|
||||
virMutexLock(&defaultLock);
|
||||
if (--defaultConnections) {
|
||||
conn->privateData = NULL;
|
||||
virMutexUnlock(&defaultLock);
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user