projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
37d41f0
)
qcow2: Free allocated snapshot table on error
author
Max Reitz
<mreitz@redhat.com>
Wed, 9 Oct 2013 08:51:05 +0000
(10:51 +0200)
committer
Kevin Wolf
<kwolf@redhat.com>
Fri, 11 Oct 2013 14:49:59 +0000
(16:49 +0200)
If an error occurs during qcow2_write_snapshots, the newly allocated
snapshot table clusters are leaked and should thus be freed.
Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/qcow2-snapshot.c
patch
|
blob
|
history
diff --git
a/block/qcow2-snapshot.c
b/block/qcow2-snapshot.c
index 33379749c19be20cde6cb08732a172d4f4eec61a..f6f3e6423d5cb8b9a8408dea1b85daeed8cb05ba 100644
(file)
--- a/
block/qcow2-snapshot.c
+++ b/
block/qcow2-snapshot.c
@@
-279,6
+279,10
@@
static int qcow2_write_snapshots(BlockDriverState *bs)
return 0;
fail:
+ if (snapshots_offset > 0) {
+ qcow2_free_clusters(bs, snapshots_offset, snapshots_size,
+ QCOW2_DISCARD_ALWAYS);
+ }
return ret;
}