aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd/hostapd_cli.c
diff options
context:
space:
mode:
authorEduardo Abinader <eduardo.abinader@openbossa.org>2014-05-29 21:42:07 (GMT)
committerJouni Malinen <j@w1.fi>2014-05-30 07:22:29 (GMT)
commitcc0b7cb188b3729eb8b9769755aa31d8dc4f34cd (patch)
tree08ca4fe3bdf9e599ca0a0aea44d35b73287d50c6 /hostapd/hostapd_cli.c
parente707f9aac7d0e57965aaad32663253ddf1554e8f (diff)
downloadhostap-cc0b7cb188b3729eb8b9769755aa31d8dc4f34cd.zip
hostap-cc0b7cb188b3729eb8b9769755aa31d8dc4f34cd.tar.gz
hostap-cc0b7cb188b3729eb8b9769755aa31d8dc4f34cd.tar.bz2
hostapd_cli: Fix segmentation fault with interface command
ctrl_ifname was not being freed and allocated consistently by using proper functions: os_free() and os_strdup(). This can result in segmentation fault when these OS specific wrappers use different implementation (e.g., with CONFIG_WPA_TRACE=y). Signed-off-by: Eduardo Abinader <eduardo.abinader@openbossa.org>
Diffstat (limited to 'hostapd/hostapd_cli.c')
-rw-r--r--hostapd/hostapd_cli.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
index c488b4f..1c4a84c 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
@@ -842,8 +842,8 @@ static int hostapd_cli_cmd_interface(struct wpa_ctrl *ctrl, int argc,
}
hostapd_cli_close_connection();
- free(ctrl_ifname);
- ctrl_ifname = strdup(argv[0]);
+ os_free(ctrl_ifname);
+ ctrl_ifname = os_strdup(argv[0]);
if (hostapd_cli_open_connection(ctrl_ifname)) {
printf("Connected to interface '%s.\n", ctrl_ifname);