aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2011-02-21 15:05:24 -0700
committerEric Blake <eblake@redhat.com>2011-02-22 09:50:34 -0700
commit009fce98be95c1674a697b850157c59bacda3168 (patch)
tree8e8e1cb81c96775529b0fe72436517ca26db9efe /src/security
parent802.1Qbh: Delay IFF_UP'ing interface until migration final stage (diff)
downloadlibvirt-009fce98be95c1674a697b850157c59bacda3168.tar.gz
libvirt-009fce98be95c1674a697b850157c59bacda3168.tar.bz2
libvirt-009fce98be95c1674a697b850157c59bacda3168.zip
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.
Diffstat (limited to 'src/security')
-rw-r--r--src/security/security_stack.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/security/security_stack.c b/src/security/security_stack.c
index 79b3e1f30..64f745af8 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;
}