qcow2: fix memory leak in qcow2_read_extensions

Free feature_table if it is failed in bdrv_pread.

Signed-off-by: lu zhipeng <luzhipeng@cestc.cn>
Message-Id: <20220921144515.1166-1-luzhipeng@cestc.cn>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
master
lu zhipeng 2022-09-21 22:45:15 +08:00 committed by Kevin Wolf
parent c8de6ec63d
commit 38f034e728
1 changed files with 1 additions and 0 deletions

View File

@ -275,6 +275,7 @@ static int qcow2_read_extensions(BlockDriverState *bs, uint64_t start_offset,
if (ret < 0) {
error_setg_errno(errp, -ret, "ERROR: ext_feature_table: "
"Could not read table");
g_free(feature_table);
return ret;
}