nbd: fix memory leak on socket_connect failed
PATCH 1/1 nbd: fix memory leak on socket_connect failed
From: y00357587 <[email protected]>
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 <[email protected]>
--- block/nbd.c | 1 + 1 file changed, 1 insertion(+)
block/nbd.c +1 -0
@@ -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 ; }
Signature · 1 line
1.8.3.1
Quoted 11 lines · yaolujing
From: y00357587 <[email protected]>
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 <[email protected]>--- block/nbd.c | 1 + 1 file changed, 1 insertion(+)
Reviewed-by Eric Blake <[email protected]>
Quoted 14 lines
block/nbd.c +1
-0@@ -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 ; }
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Paolo Bonzini
AppliedQuoted 18 lines · yaolujing
From: y00357587 <[email protected]>
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 <[email protected]>--- block/nbd.c | 1 + 1 file changed, 1 insertion(+)block/nbd.c +0
-0
block/nbd.c static QIOChannelSocket *nbd_establish_connection(SocketAddress *saddr, · line 319
Quoted 7 lines
block/nbd.c +1
-0@@ -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 ; }
Queued, thanks.
Paolo