Browse Source

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>
Helmut Schaa 16 years ago
parent
commit
81e59f1070
1 changed files with 1 additions and 1 deletions
  1. 1 1
      wpa_supplicant/wpa_supplicant.c

+ 1 - 1
wpa_supplicant/wpa_supplicant.c

@@ -2199,7 +2199,7 @@ void wpa_supplicant_deinit(struct wpa_global *global)
 
 	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])
 			continue;
 		wpa_supplicant_drivers[i]->global_deinit(global->drv_priv[i]);