[PATCH 12/20] test: fix error path in testConnectOpen

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In case of an error do the cleanup of the private data of the
connection.

Signed-off-by: Marc Hartmayer <mhartmay@xxxxxxxxxxxxxxxxxx>
Reviewed-by: Boris Fiuczynski <fiuczy@xxxxxxxxxxxxxxxxxx>
---
 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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux