mka: Fix memory leak in ieee802_1x_kay_create_live_peer() error path
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
This commit is contained in:
parent
099613e415
commit
71dc78904f
1 changed files with 4 additions and 2 deletions
|
@ -532,14 +532,16 @@ ieee802_1x_kay_create_live_peer(struct ieee802_1x_mka_participant *participant,
|
|||
peer->sak_used = FALSE;
|
||||
os_memcpy(&peer->sci, &participant->current_peer_sci,
|
||||
sizeof(peer->sci));
|
||||
dl_list_add(&participant->live_peers, &peer->list);
|
||||
|
||||
secy_get_available_receive_sc(participant->kay, &sc_ch);
|
||||
|
||||
rxsc = ieee802_1x_kay_init_receive_sc(&peer->sci, sc_ch);
|
||||
if (!rxsc)
|
||||
if (!rxsc) {
|
||||
os_free(peer);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
dl_list_add(&participant->live_peers, &peer->list);
|
||||
dl_list_add(&participant->rxsc_list, &rxsc->list);
|
||||
secy_create_receive_sc(participant->kay, rxsc);
|
||||
|
||||
|
|
Loading…
Reference in a new issue