aboutsummaryrefslogtreecommitdiff
path: root/block/qcow2.c
diff options
context:
space:
mode:
authorlu zhipeng <luzhipeng@cestc.cn>2022-09-21 22:45:15 +0800
committerKevin Wolf <kwolf@redhat.com>2022-09-30 18:02:30 +0200
commit38f034e728e5a60c27c3ac43ed2bc4ae7a6659b0 (patch)
treea03d0f59823a6abe03ce9765a5cfb8e7d975e1e0 /block/qcow2.c
parentc8de6ec63d766ca1998c5af468483ce912fdc0c2 (diff)
downloadqemu-38f034e728e5a60c27c3ac43ed2bc4ae7a6659b0.zip
qemu-38f034e728e5a60c27c3ac43ed2bc4ae7a6659b0.tar.gz
qemu-38f034e728e5a60c27c3ac43ed2bc4ae7a6659b0.tar.bz2
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>
Diffstat (limited to 'block/qcow2.c')
-rw-r--r--block/qcow2.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/block/qcow2.c b/block/qcow2.c
index c6c6692..c8fc3a6 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -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;
}