From: Amit Khatri Date: Thu, 26 Nov 2015 09:10:19 +0000 (+0530) Subject: iw: don't use NULL pointer in nla_nest_end() X-Git-Tag: v4.7~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=96fa73c7564fa7eba89cd78a24f20acd68d2f55f;p=thirdparty%2Fiw.git iw: don't use NULL pointer in nla_nest_end() Fix a crash if nla_nest_start() fails here. Signed-off-by: Amit Khatri Signed-off-by: Rahul Jain Signed-off-by: Johannes Berg --- diff --git a/wowlan.c b/wowlan.c index c30eab7..e0cf316 100644 --- a/wowlan.c +++ b/wowlan.c @@ -180,7 +180,8 @@ static int wowlan_parse_tcp_file(struct nl_msg *msg, const char *fn) err = -ENOBUFS; close: fclose(f); - nla_nest_end(msg, tcp); + if (tcp) + nla_nest_end(msg, tcp); return err; }