mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 15:15:25 +00:00
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:
parent
4a10db14bb
commit
579f02351b
@ -156,6 +156,7 @@ static void
|
|||||||
testDriverDispose(void *obj)
|
testDriverDispose(void *obj)
|
||||||
{
|
{
|
||||||
testDriverPtr driver = obj;
|
testDriverPtr driver = obj;
|
||||||
|
size_t i;
|
||||||
|
|
||||||
virObjectUnref(driver->caps);
|
virObjectUnref(driver->caps);
|
||||||
virObjectUnref(driver->xmlopt);
|
virObjectUnref(driver->xmlopt);
|
||||||
@ -165,6 +166,11 @@ testDriverDispose(void *obj)
|
|||||||
virObjectUnref(driver->ifaces);
|
virObjectUnref(driver->ifaces);
|
||||||
virObjectUnref(driver->pools);
|
virObjectUnref(driver->pools);
|
||||||
virObjectUnref(driver->eventState);
|
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;
|
typedef struct _testDomainNamespaceDef testDomainNamespaceDef;
|
||||||
|
Loading…
Reference in New Issue
Block a user