2014-09-20 18:25:41

by Yegor Yefremov

[permalink] [raw]
Subject: [PATCH 1/2] iw: remove double break

Signed-off-by: Yegor Yefremov <[email protected]>
---
event.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/event.c b/event.c
index d903f9e..25f8099 100644
--- a/event.c
+++ b/event.c
@@ -80,7 +80,6 @@ static void print_frame(struct print_event_args *args, struct nlattr *attr)
tmp = (frame[29] << 8) + frame[28];
printf(" status: %d: %s", tmp, get_status_str(tmp));
break;
- break;
case 0xa0: /* disassoc */
case 0xc0: /* deauth */
/* reason */
--
1.8.3.2



2014-09-20 18:25:50

by Yegor Yefremov

[permalink] [raw]
Subject: [PATCH 2/2] iw: fix memory leak

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


2014-10-09 14:19:25

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH 1/2] iw: remove double break

Both applied, thanks.

johannes