[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1473469015-6180-1-git-send-email-weiyj.lk@gmail.com>
Date: Sat, 10 Sep 2016 00:56:55 +0000
From: Wei Yongjun <weiyj.lk@...il.com>
To: Jon Maloy <jon.maloy@...csson.com>,
Ying Xue <ying.xue@...driver.com>,
"David S. Miller" <davem@...emloft.net>,
Richard Alpe <richard.alpe@...csson.com>
Cc: Wei Yongjun <weiyongjun1@...wei.com>, netdev@...r.kernel.org,
tipc-discussion@...ts.sourceforge.net
Subject: [PATCH -next] tipc: fix possible memory leak in tipc_udp_enable()
From: Wei Yongjun <weiyongjun1@...wei.com>
'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: ba5aa84a2d22 ("tipc: split UDP nl address parsing")
Signed-off-by: Wei Yongjun <weiyongjun1@...wei.com>
---
net/tipc/udp_media.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/tipc/udp_media.c b/net/tipc/udp_media.c
index dd27468..d80cd3f 100644
--- a/net/tipc/udp_media.c
+++ b/net/tipc/udp_media.c
@@ -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,
Powered by blists - more mailing lists