From: Marc Hartmayer Date: Thu, 8 Mar 2018 12:20:32 +0000 (+0100) Subject: test: testConnectClose: Set privateData to NULL in all cases X-Git-Tag: v4.2.0-rc1~123 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=81b2a8e0245087b6a2cb1becf36bd02f13979be7;p=thirdparty%2Flibvirt.git 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 Reviewed-by: Boris Fiuczynski Reviewed-by: John Ferlan --- diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 9ec4d806e1..d5e0db38ab 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -1472,6 +1472,7 @@ static int testConnectClose(virConnectPtr conn) dflt = true; virMutexLock(&defaultLock); if (--defaultConnections) { + conn->privateData = NULL; virMutexUnlock(&defaultLock); return 0; }