Close f, when returning before while loop.

Signed-off-by: Yegor Yefremov <[email protected]>
---
 coalesce.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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;
-- 
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to