aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2020-03-20 13:36:20 -0500
committerMax Reitz <mreitz@redhat.com>2020-03-24 11:41:46 +0100
commit71eaec2e8c7c8d266137b5c5f42da0bd6d6b5eb7 (patch)
tree0a2532c2e62ebed42d968e91c3dca9486883c1dd /block
parentf1e748d27996e0cd8269db837a32e453dd55930a (diff)
downloadqemu-71eaec2e8c7c8d266137b5c5f42da0bd6d6b5eb7.zip
qemu-71eaec2e8c7c8d266137b5c5f42da0bd6d6b5eb7.tar.gz
qemu-71eaec2e8c7c8d266137b5c5f42da0bd6d6b5eb7.tar.bz2
block: Avoid memleak on qcow2 image info failure
If we fail to get bitmap info, we must not leak the encryption info. Fixes: b8968c875f403 Fixes: Coverity CID 1421894 Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <20200320183620.1112123-1-eblake@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com> Tested-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/qcow2.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/block/qcow2.c b/block/qcow2.c
index d44b456..e08917e 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -4811,6 +4811,7 @@ static ImageInfoSpecific *qcow2_get_specific_info(BlockDriverState *bs,
if (local_err) {
error_propagate(errp, local_err);
qapi_free_ImageInfoSpecific(spec_info);
+ qapi_free_QCryptoBlockInfo(encrypt_info);
return NULL;
}
*spec_info->u.qcow2.data = (ImageInfoSpecificQCow2){