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>
Sun, 17 Dec 2017 14:07:56 +0000 (15:07 +0100)
commit1933fa485194e697b4d90853f338029ab19e4a72
tree6189cd9de136e046a40b3872c0c6dc3fff03309b
parent6efcd7eada3e76096e574e27d4e56051ffd328ab
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