[libvirt] [PATCH] Fix leak of securityDriverNames

Eric Blake eblake at redhat.com
Wed Jan 23 17:51:27 UTC 2013


On 01/23/2013 10:42 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange at redhat.com>
> 
> When shutting down, the QEMU driver forgot to free the
> securityDriverNames string list
> 
> Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
> ---
>  src/qemu/qemu_driver.c | 3 +++
>  1 file changed, 3 insertions(+)

ACK.

> 
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index 72907d2..b3d6199 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -1134,6 +1134,9 @@ qemuShutdown(void) {
>      VIR_FREE(qemu_driver->saveImageFormat);
>      VIR_FREE(qemu_driver->dumpImageFormat);
>  
> +    for (i = 0 ; qemu_driver->securityDriverNames[i] != NULL ; i++)
> +        VIR_FREE(qemu_driver->securityDriverNames[i]);
> +    VIR_FREE(qemu_driver->securityDriverNames);
>      virSecurityManagerFree(qemu_driver->securityManager);
>  
>      ebtablesContextFree(qemu_driver->ebtables);
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130123/3fbb5238/attachment-0001.sig>


More information about the libvir-list mailing list