On Thu, 09/04 21:04, Stefan Hajnoczi wrote:
> Signed-off-by: Stefan Hajnoczi <stefa...@redhat.com>
> ---
>  block/vmdk.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/block/vmdk.c b/block/vmdk.c
> index 07cb62c..9bf28f3 100644
> --- a/block/vmdk.c
> +++ b/block/vmdk.c
> @@ -834,6 +834,7 @@ static int vmdk_parse_extents(const char *desc, 
> BlockDriverState *bs,
>              ret = vmdk_add_extent(bs, extent_file, true, sectors,
>                              0, 0, 0, 0, 0, &extent, errp);
>              if (ret < 0) {
> +                bdrv_unref(extent_file);
>                  return ret;
>              }
>              extent->flat_start_offset = flat_offset << 9;
> @@ -853,6 +854,7 @@ static int vmdk_parse_extents(const char *desc, 
> BlockDriverState *bs,
>              extent = &s->extents[s->num_extents - 1];
>          } else {
>              error_setg(errp, "Unsupported extent type '%s'", type);
> +            bdrv_unref(extent_file);
>              return -ENOTSUP;
>          }
>          extent->type = g_strdup(type);
> -- 
> 1.9.3
> 
Reviewed-by: Fam Zheng <f...@redhat.com>

Reply via email to