wpa_hexdump(MSG_DEBUG, "SAE: Possible elements at the end of the frame",
*pos, end - *pos);
- if (!sae_is_rejected_groups_elem(*pos, end))
+ if (!sae_is_rejected_groups_elem(*pos, end)) {
+ wpabuf_free(sae->tmp->peer_rejected_groups);
+ sae->tmp->peer_rejected_groups = NULL;
return WLAN_STATUS_SUCCESS;
+ }
epos = *pos;
epos++; /* skip IE type */
res = sae_parse_rejected_groups(sae, &pos, end);
if (res != WLAN_STATUS_SUCCESS)
return res;
+ } else {
+ wpabuf_free(sae->tmp->peer_rejected_groups);
+ sae->tmp->peer_rejected_groups = NULL;
}
/* Optional Anti-Clogging Token Container element */