[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v2] 9pfs: fix memory leak in v9fs_write

From: Li Qiang
Subject: [Qemu-devel] [PATCH v2] 9pfs: fix memory leak in v9fs_write
Date: Wed, 12 Oct 2016 06:10:56 -0700

From: Li Qiang <address@hidden>

If an error occurs when marshal the transfer length to the guest, the
v9fs_write doesn't free an IO vector, thus leading a memory leak.
This patch fix this.

Signed-off-by: Li Qiang <address@hidden>
 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 8b50bfb..c8cf8c2 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -2090,7 +2090,7 @@ static void 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);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]