Fix a segfault in wpa_supplicant_deinit

If wpa_supplicant is started with -u but the DBus service is already
registered wpa_supplicant will bail out. However, it will segfault
in wpa_supplicant_deinit because global->drv_priv wasn't allocated
yet.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
This commit is contained in:
Helmut Schaa 2009-02-04 21:55:12 +02:00 committed by Jouni Malinen
parent 421b4ba50a
commit 81e59f1070

View File

@ -2199,7 +2199,7 @@ void wpa_supplicant_deinit(struct wpa_global *global)
eap_peer_unregister_methods(); eap_peer_unregister_methods();
for (i = 0; wpa_supplicant_drivers[i]; i++) { for (i = 0; wpa_supplicant_drivers[i] && global->drv_priv; i++) {
if (!global->drv_priv[i]) if (!global->drv_priv[i])
continue; continue;
wpa_supplicant_drivers[i]->global_deinit(global->drv_priv[i]); wpa_supplicant_drivers[i]->global_deinit(global->drv_priv[i]);