[libvirt] [PATCHv3] Fix Memory Leak in virQEMUCapsInitGuestFromBinary()

Eric Blake eblake at redhat.com
Thu Mar 27 12:58:30 UTC 2014


On 03/27/2014 05:38 AM, Nehal J Wani wrote:
> While running qemucaps2xmltest, it was found that valgrind pointed out
> the following memory leaks:
> 

> +++ b/src/qemu/qemu_capabilities.c
> @@ -1996,10 +1996,12 @@ int virQEMUCapsGetMachineTypesCaps(virQEMUCapsPtr qemuCaps,
>  
>      *nmachines = 0;

Oh, and I'm dropping this assignment, as it is dead because of...

>      *machines = NULL;
> -    if (VIR_ALLOC_N(*machines, qemuCaps->nmachineTypes) < 0)
> -        goto error;
>      *nmachines = qemuCaps->nmachineTypes;

...this assignment.

-- 
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: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140327/e2684c52/attachment-0001.sig>


More information about the libvir-list mailing list