From: Yegor Yefremov Date: Sat, 20 Sep 2014 18:25:25 +0000 (+0200) Subject: iw: fix memory leak X-Git-Tag: v3.17~3 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fiw.git;a=commitdiff_plain;h=bfb64ed00df35d302b02bfe07280409916d54a45 iw: fix memory leak Close f, when returning before while loop. Signed-off-by: Yegor Yefremov Signed-off-by: Johannes Berg --- diff --git a/coalesce.c b/coalesce.c index 0239915..0d80ceb 100644 --- a/coalesce.c +++ b/coalesce.c @@ -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;