From 6f416c78676364daf2d10d147c56455770c7dcac Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 5 Sep 2015 21:35:16 +0300 Subject: [PATCH] RSN IBSS: Fix segfault on error path If wpa_init() fails, wpa_deinit(NULL) must not be called to avoid hitting a NULL pointer dereference. Signed-off-by: Jouni Malinen --- wpa_supplicant/ibss_rsn.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wpa_supplicant/ibss_rsn.c b/wpa_supplicant/ibss_rsn.c index 6299191dd..d9d0ae7f1 100644 --- a/wpa_supplicant/ibss_rsn.c +++ b/wpa_supplicant/ibss_rsn.c @@ -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); }