projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c5fe97e
)
vmdk: fix vmdk_parse_extents() extent_file leaks
author
Stefan Hajnoczi
<stefanha@redhat.com>
Thu, 4 Sep 2014 20:04:42 +0000
(21:04 +0100)
committer
Stefan Hajnoczi
<stefanha@redhat.com>
Mon, 8 Sep 2014 10:12:44 +0000
(11:12 +0100)
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 07cb62ceb785c5c1a2479aef8d95a99a38c15f36..9bf28f3390ed28e169320891ea6d6f11f59dad7f 100644
(file)
--- 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);