From: Li Qiang <liqiang...@360.cn> If an error occurs when marshalling the transfer length to the guest, the v9fs_write() function doesn't free an IO vector, thus leading to a memory leak. This patch fixes the issue.
Signed-off-by: Li Qiang <liqiang...@360.cn> Reviewed-by: Greg Kurz <gr...@kaod.org> [groug, rephrased the changelog] Signed-off-by: Greg Kurz <gr...@kaod.org> --- hw/9pfs/9p.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index d43a55223492..e88cf257a2b9 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -2090,7 +2090,7 @@ static void coroutine_fn v9fs_write(void *opaque) offset = 7; err = pdu_marshal(pdu, offset, "d", total); if (err < 0) { - goto out; + goto out_qiov; } err += offset; trace_v9fs_write_return(pdu->tag, pdu->id, total, err); -- 2.5.5