diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c index bc54c0df1..5f1a3c631 100644 --- a/wpa_supplicant/wps_supplicant.c +++ b/wpa_supplicant/wps_supplicant.c @@ -898,6 +898,11 @@ void wpas_wps_deinit(struct wpa_supplicant *wpa_s) if (wpa_s->wps == NULL) return; +#ifdef CONFIG_WPS_ER + wps_er_deinit(wpa_s->wps_er); + wpa_s->wps_er = NULL; +#endif /* CONFIG_WPS_ER */ + wps_registrar_deinit(wpa_s->wps->registrar); wpabuf_free(wpa_s->wps->dh_pubkey); wpabuf_free(wpa_s->wps->dh_privkey); @@ -906,11 +911,6 @@ void wpas_wps_deinit(struct wpa_supplicant *wpa_s) os_free(wpa_s->wps->network_key); os_free(wpa_s->wps); wpa_s->wps = NULL; - -#ifdef CONFIG_WPS_ER - wps_er_deinit(wpa_s->wps_er); - wpa_s->wps_er = NULL; -#endif /* CONFIG_WPS_ER */ }