From 81b2a8e0245087b6a2cb1becf36bd02f13979be7 Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Thu, 8 Mar 2018 13:20:32 +0100 Subject: [PATCH] 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 --- src/test/test_driver.c | 1 + 1 file changed, 1 insertion(+) 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; } -- GitLab