When the privacy protected itentity is used for EAP-SIM/AKA, the buffer
containing the identity was freed just before its use. Fix that by
reordering the operations.
Fixes: 881cb4198b55 ("EAP-SIM/AKA peer: Simplify identity selection for MK derivation")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
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;
}