[libvirt] [PATCH 2/2] conf: Don't leak 'ram' video property on error

Eric Blake eblake at redhat.com
Thu Feb 21 20:08:50 UTC 2013


On 02/21/2013 08:49 AM, Christophe Fergeau wrote:
> It's only freed on normal returns from virDomainVideoDefParseXML,
> but not when erroring out.
> ---
>  src/conf/domain_conf.c | 1 +
>  1 file changed, 1 insertion(+)

ACK.  Again, going with a more idiomatic cleanup label that cleans up on
both success and error might also work, and might also be part of
Peter's series.

> 
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index 258ee93..0c75838 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -7736,6 +7736,7 @@ virDomainVideoDefParseXML(const xmlNodePtr node,
>  error:
>      virDomainVideoDefFree(def);
>      VIR_FREE(type);
> +    VIR_FREE(ram);
>      VIR_FREE(vram);
>      VIR_FREE(heads);
>      return NULL;
> 

-- 
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/20130221/12c9c4d6/attachment-0001.sig>


More information about the libvir-list mailing list