aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2012-05-21 13:06:54 +0200
committerKevin Wolf <kwolf@redhat.com>2012-05-25 18:12:54 +0200
commitb6c147622d31272f9728da9ec16d146bf8c45a74 (patch)
tree2780f0caf94a3fd9be74746c9160f31b2294a462 /block
parentaeb29b6459cb9496b38c820f3faff64cf2369d0d (diff)
downloadqemu-b6c147622d31272f9728da9ec16d146bf8c45a74.zip
qemu-b6c147622d31272f9728da9ec16d146bf8c45a74.tar.gz
qemu-b6c147622d31272f9728da9ec16d146bf8c45a74.tar.bz2
qcow2: don't leak buffer for unexpected qcow_version in header
Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/qcow2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/block/qcow2.c b/block/qcow2.c
index 655799c..c2e49cd 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -919,7 +919,8 @@ int qcow2_update_header(BlockDriverState *bs)
ret = sizeof(*header);
break;
default:
- return -EINVAL;
+ ret = -EINVAL;
+ goto fail;
}
buf += ret;