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

Commit c20cb811 authored by Wei Yongjun's avatar Wei Yongjun Committed by David S. Miller
Browse files

tipc: fix possible memory leak in tipc_udp_enable()



'ub' is malloced in tipc_udp_enable() and should be freed before
leaving from the error handling cases, otherwise it will cause
memory leak.

Fixes: ba5aa84a ("tipc: split UDP nl address parsing")
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 30843315
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -665,7 +665,8 @@ static int tipc_udp_enable(struct net *net, struct tipc_bearer *b,

	if (!opts[TIPC_NLA_UDP_LOCAL] || !opts[TIPC_NLA_UDP_REMOTE]) {
		pr_err("Invalid UDP bearer configuration");
		return -EINVAL;
		err = -EINVAL;
		goto err;
	}

	err = tipc_parse_udp_addr(opts[TIPC_NLA_UDP_LOCAL], &local,