qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/2] qcow2: Fix memory leak in copy_sectors()


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 1/2] qcow2: Fix memory leak in copy_sectors()
Date: Wed, 28 May 2014 16:33:19 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

On 05/28/2014 04:19 PM, Max Reitz wrote:
> If bs->drv is NULL, iov.iov_base should not be leaked.
> 
> Signed-off-by: Max Reitz <address@hidden>
> ---
>  block/qcow2-cluster.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Reviewed-by: Eric Blake <address@hidden>

> 
> diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
> index 33e6826..d391c5a 100644
> --- a/block/qcow2-cluster.c
> +++ b/block/qcow2-cluster.c
> @@ -387,7 +387,8 @@ static int coroutine_fn copy_sectors(BlockDriverState *bs,
>      BLKDBG_EVENT(bs->file, BLKDBG_COW_READ);
>  
>      if (!bs->drv) {
> -        return -ENOMEDIUM;
> +        ret = -ENOMEDIUM;
> +        goto out;
>      }
>  
>      /* Call .bdrv_co_readv() directly instead of using the public block-layer
> 

-- 
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]