[libvirt PATCH] test: fix leak of authentication info

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

 



The 'auths' struct in the test driver was not free()d. This was easy to
miss because the default XML doesn't include auth info.

Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
---
 src/test/test_driver.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 029d560fb9..73fe1ad6ce 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -156,6 +156,7 @@ static void
 testDriverDispose(void *obj)
 {
     testDriverPtr driver = obj;
+    size_t i;
 
     virObjectUnref(driver->caps);
     virObjectUnref(driver->xmlopt);
@@ -165,6 +166,11 @@ testDriverDispose(void *obj)
     virObjectUnref(driver->ifaces);
     virObjectUnref(driver->pools);
     virObjectUnref(driver->eventState);
+    for (i = 0; i < driver->numAuths; i++) {
+        g_free(driver->auths[i].username);
+        g_free(driver->auths[i].password);
+    }
+    g_free(driver->auths);
 }
 
 typedef struct _testDomainNamespaceDef testDomainNamespaceDef;
-- 
2.24.1





[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