* [PATCH] qcow2: fix memory leak in qcow2_read_extensions
@ 2022-09-21 14:45 luzhipeng
2022-09-22 15:08 ` Kevin Wolf
0 siblings, 1 reply; 2+ messages in thread
From: luzhipeng @ 2022-09-21 14:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Kevin Wolf, Hanna Reitz, lu zhipeng
From: lu zhipeng <luzhipeng@cestc.cn>
Free feature_table if it is failed in bdrv_pread.
Signed-off-by: lu zhipeng <luzhipeng@cestc.cn>
---
block/qcow2.c | 1 +
1 file changed, 1 insertion(+)
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;
}
--
2.31.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] qcow2: fix memory leak in qcow2_read_extensions
2022-09-21 14:45 [PATCH] qcow2: fix memory leak in qcow2_read_extensions luzhipeng
@ 2022-09-22 15:08 ` Kevin Wolf
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Wolf @ 2022-09-22 15:08 UTC (permalink / raw)
To: luzhipeng; +Cc: qemu-devel, Hanna Reitz
Am 21.09.2022 um 16:45 hat luzhipeng geschrieben:
> From: lu zhipeng <luzhipeng@cestc.cn>
>
> Free feature_table if it is failed in bdrv_pread.
>
> Signed-off-by: lu zhipeng <luzhipeng@cestc.cn>
Thanks, applied to the block branch.
Kevin
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-09-22 15:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-21 14:45 [PATCH] qcow2: fix memory leak in qcow2_read_extensions luzhipeng
2022-09-22 15:08 ` Kevin Wolf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).