[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/6] qcow2: don't leak buffer for unexpected qco
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH 1/6] qcow2: don't leak buffer for unexpected qcow_version in header |
Date: |
Mon, 21 May 2012 12:57:49 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 |
Am 16.05.2012 15:07, schrieb Jim Meyering:
> From: Jim Meyering <address@hidden>
>
>
> Signed-off-by: Jim Meyering <address@hidden>
> ---
> block/qcow2.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/block/qcow2.c b/block/qcow2.c
> index 655799c..f3388bf 100644
> --- a/block/qcow2.c
> +++ b/block/qcow2.c
> @@ -919,6 +919,7 @@ int qcow2_update_header(BlockDriverState *bs)
> ret = sizeof(*header);
> break;
> default:
> + free(buf);
> return -EINVAL;
> }
>
buf was allocated with qemu_blockalign(), so it must be freed with
qemu_vfree(). But instead of open-coding it here, this place should work
like all other places in the same function:
ret = -EINVAL;
goto fail;
Kevin