[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] block/vvfat: Fix memleaks in vvfat_close()
From: |
Hanna Reitz |
Subject: |
[PATCH] block/vvfat: Fix memleaks in vvfat_close() |
Date: |
Mon, 7 Feb 2022 12:37:16 +0100 |
qcow_filename and used_clusters are allocated in enable_write_target(),
but freed only in the error path of vvfat_open(). Free them in
vvfat_close(), too.
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
---
block/vvfat.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/block/vvfat.c b/block/vvfat.c
index b2b58d93b8..811ba76e30 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -3213,6 +3213,8 @@ static void vvfat_close(BlockDriverState *bs)
array_free(&(s->directory));
array_free(&(s->mapping));
g_free(s->cluster_buffer);
+ g_free(s->qcow_filename);
+ g_free(s->used_clusters);
if (s->qcow) {
migrate_del_blocker(s->migration_blocker);
--
2.34.1
- [PATCH] block/vvfat: Fix memleaks in vvfat_close(),
Hanna Reitz <=