diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c index 5ab11281e..f7ce80211 100644 --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c @@ -3082,6 +3082,17 @@ static int wpa_config_process_ap_vendor_elements( } +static int wpa_config_process_no_ctrl_interface( + const struct global_parse_data *data, + struct wpa_config *config, int line, const char *pos) +{ + wpa_printf(MSG_DEBUG, "no_ctrl_interface -> ctrl_interface=NULL"); + os_free(config->ctrl_interface); + config->ctrl_interface = NULL; + return 0; +} + + #ifdef OFFSET #undef OFFSET #endif /* OFFSET */ @@ -3101,6 +3112,7 @@ static int wpa_config_process_ap_vendor_elements( static const struct global_parse_data global_fields[] = { #ifdef CONFIG_CTRL_IFACE { STR(ctrl_interface), 0 }, + { FUNC_NO_VAR(no_ctrl_interface), 0 }, { STR(ctrl_interface_group), 0 } /* deprecated */, #endif /* CONFIG_CTRL_IFACE */ { INT_RANGE(eapol_version, 1, 2), 0 }, diff --git a/wpa_supplicant/ctrl_iface_unix.c b/wpa_supplicant/ctrl_iface_unix.c index 8abf57d10..5fe9a4e43 100644 --- a/wpa_supplicant/ctrl_iface_unix.c +++ b/wpa_supplicant/ctrl_iface_unix.c @@ -586,6 +586,8 @@ void wpa_supplicant_ctrl_iface_deinit(struct ctrl_iface_priv *priv) os_free(fname); } + if (priv->wpa_s->conf->ctrl_interface == NULL) + goto free_dst; buf = os_strdup(priv->wpa_s->conf->ctrl_interface); if (buf == NULL) goto free_dst;