tipc: fix memory leak in tipc_accept_from_sock()
authorJon Maloy <jon.maloy@ericsson.com>
Mon, 4 Dec 2017 21:00:20 +0000 (22:00 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 16 Dec 2017 09:33:56 +0000 (10:33 +0100)
commit827fd89bc552a7ac916707225ca3de1f516d3b9c
tree5ef020f0184c7ac304ae784d5af7cb4b198c7a43
parent047a7bb12d63c41569ce9c9e88f5b231fd1f6cf5
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>
net/tipc/server.c