clib_memcpy (&cct->c_rmt_ip, &args->ip, sizeof (args->ip));
cct->actual_tp = ll_ct->actual_tp;
cct->is_client = 1;
+ cct->c_s_index = ~0;
/*
* Init server transport
if (peer_ct)
{
peer_ct->peer_index = ~0;
- session_transport_closing_notify (&peer_ct->connection);
+ /* Make sure session was allocated */
+ if (peer_ct->c_s_index != ~0)
+ session_transport_closing_notify (&peer_ct->connection);
+ else
+ ct_connection_free (peer_ct);
}
s = session_get (ct->c_s_index, ct->c_thread_index);