[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH] nbd: fix memory leak on socket_connect failed
From: |
yaolujing |
Subject: |
[Qemu-block] [PATCH] nbd: fix memory leak on socket_connect failed |
Date: |
Sat, 1 Apr 2017 08:15:09 +0800 |
From: y00357587 <address@hidden>
When TCP connection fails between nbd server and client,
the local var, sioc, memory leak.
This patch fixes the memory leak.
Signed-off-by: y00357587 <address@hidden>
---
block/nbd.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/block/nbd.c b/block/nbd.c
index 35f24be..102285e 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -313,6 +313,7 @@ static QIOChannelSocket
*nbd_establish_connection(SocketAddress *saddr,
saddr,
&local_err);
if (local_err) {
+ object_unref(OBJECT(sioc));
error_propagate(errp, local_err);
return NULL;
}
--
1.8.3.1
- [Qemu-block] [PATCH] nbd: fix memory leak on socket_connect failed,
yaolujing <=