diff options
author | Stefan Hajnoczi <stefanha@redhat.com> | 2014-09-04 21:04:43 +0100 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2014-09-08 11:12:44 +0100 |
commit | b6b1d31f098eef8cd13556d343e46c213fac972a (patch) | |
tree | d26f301c75bdc8d5651492a912f1a63c7e16b056 /block/vmdk.c | |
parent | ff74f33c310892c90c4439d963a6ce67f47ce18c (diff) | |
download | qemu-b6b1d31f098eef8cd13556d343e46c213fac972a.zip qemu-b6b1d31f098eef8cd13556d343e46c213fac972a.tar.gz qemu-b6b1d31f098eef8cd13556d343e46c213fac972a.tar.bz2 |
vmdk: fix buf leak in vmdk_parse_extents()
vmdk_open_sparse() does not take ownership of buf so the caller always
needs to free it.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Diffstat (limited to 'block/vmdk.c')
-rw-r--r-- | block/vmdk.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/vmdk.c b/block/vmdk.c index 9bf28f3..a1cb911 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -846,8 +846,8 @@ static int vmdk_parse_extents(const char *desc, BlockDriverState *bs, } else { ret = vmdk_open_sparse(bs, extent_file, bs->open_flags, buf, errp); } + g_free(buf); if (ret) { - g_free(buf); bdrv_unref(extent_file); return ret; } |