diff options
author | Juan Quintela <quintela@redhat.com> | 2010-03-04 10:00:37 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-03-09 11:23:00 -0600 |
commit | 81d06ac9e6416476479eebcd16a98afa9176a38e (patch) | |
tree | b6fdd161d4fb8768bc1602aed1ff7ca2a226abdd /block/vmdk.c | |
parent | 005859178c88afda498cd5671467a00f5cfeae21 (diff) | |
download | qemu-81d06ac9e6416476479eebcd16a98afa9176a38e.tar.gz qemu-81d06ac9e6416476479eebcd16a98afa9176a38e.tar.bz2 qemu-81d06ac9e6416476479eebcd16a98afa9176a38e.zip |
vmdk: share cleanup code
cleanup code is identical for error/success cases. Only difference
are goto labels.
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'block/vmdk.c')
-rw-r--r-- | block/vmdk.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/block/vmdk.c b/block/vmdk.c index 819c1c9fc5..007fca4c70 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -334,18 +334,13 @@ static int vmdk_snapshot_create(const char *filename, const char *backing_file) ret = -errno; goto fail_gd; } - qemu_free(gd_buf); - qemu_free(rgd_buf); - - close(p_fd); - close(snp_fd); - return 0; + ret = 0; - fail_gd: +fail_gd: qemu_free(gd_buf); - fail_rgd: +fail_rgd: qemu_free(rgd_buf); - fail: +fail: close(p_fd); close(snp_fd); return ret; |