[libvirt] [PATCH 1/2] coverity: fix memory leak in error path in virnetlink.c

Eric Blake eblake at redhat.com
Thu May 3 17:18:25 UTC 2012


On 05/03/2012 09:28 AM, Guannan Ren wrote:
> ---
>  src/util/virnetlink.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c
> index b2e9d51..e199d62 100644
> --- a/src/util/virnetlink.c
> +++ b/src/util/virnetlink.c
> @@ -340,8 +340,10 @@ virNetlinkEventServiceStart(void)
>          goto error;
>      }
>  
> -    if (virMutexInit(&srv->lock) < 0)
> +    if (virMutexInit(&srv->lock) < 0) {
> +        VIR_FREE(srv);
>          goto error;
> +    }

This repeats the patch already posted here:
https://www.redhat.com/archives/libvir-list/2012-May/msg00119.html

-- 
Eric Blake   eblake at 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: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120503/5f1944c9/attachment-0001.sig>


More information about the libvir-list mailing list