mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-12 15:52:55 +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;
|
goto error;
|
||||||
|
|
||||||
if (!(driver->securityManager = virSecurityManagerNewStack(mgr,
|
if (!(driver->securityManager = virSecurityManagerNewStack(mgr,
|
||||||
dac)))
|
dac))) {
|
||||||
|
|
||||||
|
virSecurityManagerFree(dac);
|
||||||
goto error;
|
goto error;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
driver->securityManager = mgr;
|
driver->securityManager = mgr;
|
||||||
}
|
}
|
||||||
|
@ -61,8 +61,13 @@ virSecurityStackOpen(virSecurityManagerPtr mgr ATTRIBUTE_UNUSED)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
virSecurityStackClose(virSecurityManagerPtr mgr ATTRIBUTE_UNUSED)
|
virSecurityStackClose(virSecurityManagerPtr mgr)
|
||||||
{
|
{
|
||||||
|
virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr);
|
||||||
|
|
||||||
|
virSecurityManagerFree(priv->primary);
|
||||||
|
virSecurityManagerFree(priv->secondary);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user