]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: fix memory leak
authorYegor Yefremov <yegorslists@googlemail.com>
Sat, 20 Sep 2014 18:25:25 +0000 (20:25 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 9 Oct 2014 14:19:06 +0000 (16:19 +0200)
Close f, when returning before while loop.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
coalesce.c

index 02399151bf36a7f0306e3cf0a39953653420ceb4..0d80cebcfaca51695e8d392df8dac1ba209a20fd 100644 (file)
@@ -38,8 +38,10 @@ static int handle_coalesce_enable(struct nl80211_state *state, struct nl_cb *cb,
                return 1;
 
        nl_rules = nla_nest_start(msg, NL80211_ATTR_COALESCE_RULE);
-       if (!nl_rules)
+       if (!nl_rules) {
+               fclose(f);
                return -ENOBUFS;
+       }
 
        while (!feof(f)) {
                char *eol;