diff --git a/src/eap_peer/eap.c b/src/eap_peer/eap.c index 4df88539b..c0d707861 100644 --- a/src/eap_peer/eap.c +++ b/src/eap_peer/eap.c @@ -406,9 +406,11 @@ SM_STATE(EAP, METHOD) sm->eapKeyData = sm->m->getKey(sm, sm->eap_method_priv, &sm->eapKeyDataLen); os_free(sm->eapSessionId); - sm->eapSessionId = sm->m->getSessionId(sm, sm->eap_method_priv, - &sm->eapSessionIdLen); - if (sm->eapSessionId) { + sm->eapSessionId = NULL; + if (sm->m->getSessionId) { + sm->eapSessionId = sm->m->getSessionId( + sm, sm->eap_method_priv, + &sm->eapSessionIdLen); wpa_hexdump(MSG_DEBUG, "EAP: Session-Id", sm->eapSessionId, sm->eapSessionIdLen); }