diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 0f25a2a9d92bffab17a439d703427edb4e4d3379..8b15a3edb272f79e7542089836588062d0412fc5 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -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; } diff --git a/src/security/security_stack.c b/src/security/security_stack.c index 79b3e1f30f4c008f4e1a0d65846bed4e4f5f1ecc..64f745af887b5eed4118b1afe1363e2c9bca4cd5 100644 --- a/src/security/security_stack.c +++ b/src/security/security_stack.c @@ -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; }