From: Eduardo Abinader Date: Thu, 29 May 2014 21:42:07 +0000 (-0400) Subject: hostapd_cli: Fix segmentation fault with interface command X-Git-Tag: hostap_2_2~46 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cc0b7cb188b3729eb8b9769755aa31d8dc4f34cd;p=thirdparty%2Fhostap.git 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 --- diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c index c488b4fd7..1c4a84c65 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);