test: fix leak of authentication info

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.

Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2020-03-05 15:41:49 +00:00
parent 4a10db14bb
commit 579f02351b

View File

@ -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;