block/nbd: Fix the leaked visitor
PATCH v3 1/1 block/nbd: Fix the leaked visitor
This patch frees the leaked visitor in nbd_refresh_filename() and uses visit_free() to fix it. The leak was introduced by the commit 491d6c7.
Signed-off-by Ashijeet Acharya <[email protected]>
Reviewed-by Eric Blake <[email protected]>
---
Changes in v3:
- Modify the Subject line
- Free the visitor immediately after visit_complete()
--- block/nbd.c | 1 + 1 file changed, 1 insertion(+)
block/nbd.c +1 -0
@@ -534,6 +534,7 @@ static void nbd_refresh_filename(BlockDriverState *bs, QDict *options) ov =qobject_output_visitor_new (&saddr_qdict);visit_type_SocketAddress (ov,NULL , &s->saddr, &error_abort);visit_complete (ov, &saddr_qdict); +visit_free (ov);assert (qobject_type (saddr_qdict) ==QTYPE_QDICT );qdict_put_obj (opts,"server" , saddr_qdict);
Signature · 1 line
2.6.2
Kevin Wolf
AppliedAm 02.11.2016 um 11:40 hat Ashijeet Acharya geschrieben:
Quoted 5 lines
This patch frees the leaked visitor in
nbd_refresh_filename()and usesvisit_free()to fix it. The leak was introduced by the commit 491d6c7.Signed-off-by Ashijeet Acharya <[email protected]>Reviewed-by Eric Blake <[email protected]>
Thanks, applied to the block branch.
Kevin