* [Qemu-devel] [PATCH] fix memory leak when we uninit a drive
@ 2011-02-16 2:23 Wen Congyang
2011-02-16 9:43 ` Markus Armbruster
0 siblings, 1 reply; 2+ messages in thread
From: Wen Congyang @ 2011-02-16 2:23 UTC (permalink / raw)
To: qemu-devel
We alloc memory for dinfo->id, so we should free it in
the function drive_uninit().
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
---
blockdev.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/blockdev.c b/blockdev.c
index ecfadc1..1333a4e 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -183,6 +183,8 @@ static void drive_uninit(DriveInfo *dinfo)
qemu_opts_del(dinfo->opts);
bdrv_delete(dinfo->bdrv);
QTAILQ_REMOVE(&drives, dinfo, next);
+ if (dinfo->id)
+ qemu_free(dinfo->id);
qemu_free(dinfo);
}
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] fix memory leak when we uninit a drive
2011-02-16 2:23 [Qemu-devel] [PATCH] fix memory leak when we uninit a drive Wen Congyang
@ 2011-02-16 9:43 ` Markus Armbruster
0 siblings, 0 replies; 2+ messages in thread
From: Markus Armbruster @ 2011-02-16 9:43 UTC (permalink / raw)
To: Wen Congyang; +Cc: qemu-devel
Wen Congyang <wency@cn.fujitsu.com> writes:
> We alloc memory for dinfo->id, so we should free it in
> the function drive_uninit().
Already fixed in Kevin's block tree and 0.14-rc2 (commit e5f1c196),
although not yet in stable.
Thanks anyway!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-02-16 9:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-16 2:23 [Qemu-devel] [PATCH] fix memory leak when we uninit a drive Wen Congyang
2011-02-16 9:43 ` Markus Armbruster
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).