diff --git a/src/eap_peer/eap.c b/src/eap_peer/eap.c index 199ea0aab..935286242 100644 --- a/src/eap_peer/eap.c +++ b/src/eap_peer/eap.c @@ -1757,12 +1757,13 @@ struct wpabuf * eap_sm_buildIdentity(struct eap_sm *sm, int id, int encrypted) return NULL; wpabuf_put_data(resp, identity, identity_len); - wpabuf_free(privacy_identity); os_free(sm->identity); sm->identity = os_memdup(identity, identity_len); sm->identity_len = identity_len; + wpabuf_free(privacy_identity); + return resp; }