Skip to content
Snippets Groups Projects
Commit 71eaec2e authored by Eric Blake's avatar Eric Blake Committed by Max Reitz
Browse files

block: Avoid memleak on qcow2 image info failure


If we fail to get bitmap info, we must not leak the encryption info.

Fixes: b8968c87
Fixes: Coverity CID 1421894
Signed-off-by: default avatarEric Blake <eblake@redhat.com>
Message-Id: <20200320183620.1112123-1-eblake@redhat.com>
Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: default avatarAndrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Tested-by: default avatarAndrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
parent f1e748d2
Branches
No related tags found
No related merge requests found
......@@ -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){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment