summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJon Maloy <jon.maloy@ericsson.com>2017-12-04 22:00:20 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-12-16 10:33:56 +0100
commit827fd89bc552a7ac916707225ca3de1f516d3b9c (patch)
tree5ef020f0184c7ac304ae784d5af7cb4b198c7a43 /net
parent047a7bb12d63c41569ce9c9e88f5b231fd1f6cf5 (diff)
downloadlinux-stable-827fd89bc552a7ac916707225ca3de1f516d3b9c.tar.gz
linux-stable-827fd89bc552a7ac916707225ca3de1f516d3b9c.tar.bz2
linux-stable-827fd89bc552a7ac916707225ca3de1f516d3b9c.zip
tipc: fix memory leak in tipc_accept_from_sock()
[ Upstream commit a7d5f107b4978e08eeab599ee7449af34d034053 ] When the function tipc_accept_from_sock() fails to create an instance of struct tipc_subscriber it omits to free the already created instance of struct tipc_conn instance before it returns. We fix that with this commit. Reported-by: David S. Miller <davem@davemloft.net> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r--net/tipc/server.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/tipc/server.c b/net/tipc/server.c
index c416e5184a3f..f351863076c2 100644
--- a/net/tipc/server.c
+++ b/net/tipc/server.c
@@ -311,6 +311,7 @@ static int tipc_accept_from_sock(struct tipc_conn *con)
newcon->usr_data = s->tipc_conn_new(newcon->conid);
if (!newcon->usr_data) {
sock_release(newsock);
+ conn_put(newcon);
return -ENOMEM;
}