aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/config.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-06-29 21:56:27 (GMT)
committerJouni Malinen <j@w1.fi>2014-07-02 09:38:48 (GMT)
commita1e46f320d32b24b231663eecdb501f80c486f32 (patch)
tree7ecf7ff56eb7fdc4c14cb3d0fc070da36942a117 /wpa_supplicant/config.c
parent290ea6a76e5774591765bcf1eba86e56da5cdf00 (diff)
downloadhostap-a1e46f320d32b24b231663eecdb501f80c486f32.zip
hostap-a1e46f320d32b24b231663eecdb501f80c486f32.tar.gz
hostap-a1e46f320d32b24b231663eecdb501f80c486f32.tar.bz2
Check for no key_mgmt/proto/auth_alg entries in config writer
This is not really necessary check, but it keeps a static analyzer happier by avoiding dead increment. Doing it this way rather than removing the increment is less likely to cause problems when new entries are added here in the future (the "dead" increment would be very much needed in those cases). Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/config.c')
-rw-r--r--wpa_supplicant/config.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index 16031c9..36558c9 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -467,6 +467,11 @@ static char * wpa_config_write_proto(const struct parse_data *data,
pos += ret;
}
+ if (pos == buf) {
+ os_free(buf);
+ buf = NULL;
+ }
+
return buf;
}
#endif /* NO_CONFIG_WRITE */
@@ -672,6 +677,11 @@ static char * wpa_config_write_key_mgmt(const struct parse_data *data,
}
#endif /* CONFIG_WPS */
+ if (pos == buf) {
+ os_free(buf);
+ buf = NULL;
+ }
+
return buf;
}
#endif /* NO_CONFIG_WRITE */
@@ -863,6 +873,11 @@ static char * wpa_config_write_auth_alg(const struct parse_data *data,
pos += ret;
}
+ if (pos == buf) {
+ os_free(buf);
+ buf = NULL;
+ }
+
return buf;
}
#endif /* NO_CONFIG_WRITE */