]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: don't use NULL pointer in nla_nest_end()
authorAmit Khatri <amit.khatri@samsung.com>
Thu, 26 Nov 2015 09:10:19 +0000 (14:40 +0530)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 26 Nov 2015 17:43:13 +0000 (18:43 +0100)
Fix a crash if nla_nest_start() fails here.

Signed-off-by: Amit Khatri <amit.khatri@samsung.com>
Signed-off-by: Rahul Jain <rahul.jain@samsung.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
wowlan.c

index c30eab774ff4239dc251075f7a86dd203b744cd3..e0cf316b165e5f89f69be44eaa6aed82fe4dcbb2 100644 (file)
--- 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;
 }