Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a7d5f107 authored by Jon Maloy's avatar Jon Maloy Committed by David S. Miller
Browse files

tipc: fix memory leak in tipc_accept_from_sock()



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: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 672ecbe1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -314,6 +314,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;
	}