session: fix ct get peer if peer freed

Type: fix

Change-Id: Iae00637ab843121651f187436bf849f41874f48c
Signed-off-by: Florin Coras <fcoras@cisco.com>
This commit is contained in:
Florin Coras 2024-11-20 15:04:20 -08:00 committed by Dave Barach
parent 79c8f99ac9
commit 9cab992ff9

View File

@ -160,6 +160,8 @@ ct_session_get_peer (session_t * s)
ct_connection_t *ct, *peer_ct;
ct = ct_connection_get (s->connection_index, s->thread_index);
peer_ct = ct_connection_get (ct->peer_index, s->thread_index);
if (!peer_ct)
return 0;
return session_get (peer_ct->c_s_index, s->thread_index);
}