mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 06:35:24 +00:00
security: avoid memory leak
Leak introduced in commit d6623003
.
* src/qemu/qemu_driver.c (qemuSecurityInit): Avoid leak on failure.
* src/security/security_stack.c (virSecurityStackClose): Avoid
leaking component drivers.
This commit is contained in:
parent
dfd39ccda8
commit
009fce98be
@ -204,8 +204,11 @@ qemuSecurityInit(struct qemud_driver *driver)
|
||||
goto error;
|
||||
|
||||
if (!(driver->securityManager = virSecurityManagerNewStack(mgr,
|
||||
dac)))
|
||||
dac))) {
|
||||
|
||||
virSecurityManagerFree(dac);
|
||||
goto error;
|
||||
}
|
||||
} else {
|
||||
driver->securityManager = mgr;
|
||||
}
|
||||
|
@ -61,8 +61,13 @@ virSecurityStackOpen(virSecurityManagerPtr mgr ATTRIBUTE_UNUSED)
|
||||
}
|
||||
|
||||
static int
|
||||
virSecurityStackClose(virSecurityManagerPtr mgr ATTRIBUTE_UNUSED)
|
||||
virSecurityStackClose(virSecurityManagerPtr mgr)
|
||||
{
|
||||
virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr);
|
||||
|
||||
virSecurityManagerFree(priv->primary);
|
||||
virSecurityManagerFree(priv->secondary);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user