qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] nbd: fix memory leak on socket_connect failed
@ 2017-04-01  0:15 yaolujing
  2017-04-01 14:37 ` [Qemu-devel] [PATCH for-2.9] " Eric Blake
  2017-04-03  7:06 ` [Qemu-devel] [PATCH] " Paolo Bonzini
  0 siblings, 2 replies; 3+ messages in thread
From: yaolujing @ 2017-04-01  0:15 UTC (permalink / raw)
  To: pbonzini, kwolf, mreitz
  Cc: sochin.jiang, xieyingtai, eric.fangyi, subo7, wangjie88,
	zhangshuai13, yaolujing, qemu-block, qemu-devel

From: y00357587 <yaolujing@huawei.com>

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 <yaolujing@huawei.com>
---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-04-03  7:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-01  0:15 [Qemu-devel] [PATCH] nbd: fix memory leak on socket_connect failed yaolujing
2017-04-01 14:37 ` [Qemu-devel] [PATCH for-2.9] " Eric Blake
2017-04-03  7:06 ` [Qemu-devel] [PATCH] " Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).