qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 12/14] block/vvfat: Plug memory leak in read_dir


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 12/14] block/vvfat: Plug memory leak in read_directory()
Date: Tue, 27 May 2014 09:02:26 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

On 05/26/2014 11:37 AM, Markus Armbruster wrote:
> Has always been leaky.  Spotted by Coverity.
> 
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
>  block/vvfat.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/block/vvfat.c b/block/vvfat.c
> index 2c82a5c..389704a 100644
> --- a/block/vvfat.c
> +++ b/block/vvfat.c
> @@ -787,7 +787,9 @@ static int read_directory(BDRVVVFATState* s, int 
> mapping_index)
>           s->current_mapping->path=buffer;
>           s->current_mapping->read_only =
>               (st.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH)) == 0;
> -     }
> +     } else {

Looks odd to have TAB here,

> +            g_free(buffer);
> +        }

but not here

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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]