Am 16.05.2012 15:07, schrieb Jim Meyering:
> From: Jim Meyering <meyer...@redhat.com>
> 
> 
> Signed-off-by: Jim Meyering <meyer...@redhat.com>
> ---
>  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

Reply via email to