diff options
author | lu zhipeng <luzhipeng@cestc.cn> | 2022-09-21 22:45:15 +0800 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2022-09-30 18:02:30 +0200 |
commit | 38f034e728e5a60c27c3ac43ed2bc4ae7a6659b0 (patch) | |
tree | a03d0f59823a6abe03ce9765a5cfb8e7d975e1e0 /block/qcow2.c | |
parent | c8de6ec63d766ca1998c5af468483ce912fdc0c2 (diff) |
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.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/block/qcow2.c b/block/qcow2.c index c6c6692fb7..c8fc3a6160 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; } |