fix memory leak when we uninit a drive
PATCH 1/1 fix memory leak when we uninit a drive
We alloc memory for dinfo->id, so we should free it in the function drive_uninit().
Signed-off-by Wen Congyang <[email protected]>
--- blockdev.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
blockdev.c +2 -0
@@ -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); }
Signature · 1 line
1.7.1
Quoted 2 lines · Wen Congyang
We alloc memory for
dinfo->id, so we should free it in the functiondrive_uninit().
Already fixed in Kevin's block tree and 0.14-rc2 (commit e5f1c196), although not yet in stable.
Thanks anyway!