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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]