RSN IBSS: Fix segfault on error path
authorJouni Malinen <j@w1.fi>
Sat, 5 Sep 2015 18:35:16 +0000 (21:35 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 5 Sep 2015 18:35:16 +0000 (21:35 +0300)
If wpa_init() fails, wpa_deinit(NULL) must not be called to avoid
hitting a NULL pointer dereference.

Signed-off-by: Jouni Malinen <j@w1.fi>
wpa_supplicant/ibss_rsn.c

index 6299191..d9d0ae7 100644 (file)
@@ -697,7 +697,8 @@ void ibss_rsn_deinit(struct ibss_rsn *ibss_rsn)
                ibss_rsn_free(prev);
        }
 
-       wpa_deinit(ibss_rsn->auth_group);
+       if (ibss_rsn->auth_group)
+               wpa_deinit(ibss_rsn->auth_group);
        os_free(ibss_rsn);
 
 }