projects
/
sdk
/
emulator
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ff74f33
)
vmdk: fix buf leak in vmdk_parse_extents()
author
Stefan Hajnoczi
<stefanha@redhat.com>
Thu, 4 Sep 2014 20:04:43 +0000
(21:04 +0100)
committer
Stefan Hajnoczi
<stefanha@redhat.com>
Mon, 8 Sep 2014 10:12:44 +0000
(11:12 +0100)
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>
block/vmdk.c
patch
|
blob
|
history
diff --git
a/block/vmdk.c
b/block/vmdk.c
index 9bf28f3390ed28e169320891ea6d6f11f59dad7f..a1cb91131e28bdbf9acda96275b60165926f83d8 100644
(file)
--- 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;
}