Commit 801e6f9a authored by Olivier Crête's avatar Olivier Crête

conncheck: Don't use CandidateRefresh after freeing it

parent 34502d67
......@@ -787,6 +787,7 @@ static gboolean priv_conn_keepalive_tick (gpointer pointer)
static gboolean priv_turn_allocate_refresh_retransmissions_tick (gpointer pointer)
{
CandidateRefresh *cand = (CandidateRefresh *) pointer;
NiceAgent *agent = NULL;
agent_lock();
......@@ -806,6 +807,8 @@ static gboolean priv_turn_allocate_refresh_retransmissions_tick (gpointer pointe
g_source_unref (cand->tick_source);
cand->tick_source = NULL;
agent = g_object_ref (cand->agent);
switch (stun_timer_refresh (&cand->timer)) {
case STUN_USAGE_TIMER_RETURN_TIMEOUT:
{
......@@ -823,12 +826,12 @@ static gboolean priv_turn_allocate_refresh_retransmissions_tick (gpointer pointe
agent_socket_send (cand->nicesock, &cand->server,
stun_message_length (&cand->stun_message), (gchar *)cand->stun_buffer);
agent_timeout_add_with_context (cand->agent, &cand->tick_source,
agent_timeout_add_with_context (agent, &cand->tick_source,
"Candidate TURN refresh", stun_timer_remainder (&cand->timer),
priv_turn_allocate_refresh_retransmissions_tick, cand);
break;
case STUN_USAGE_TIMER_RETURN_SUCCESS:
agent_timeout_add_with_context (cand->agent, &cand->tick_source,
agent_timeout_add_with_context (agent, &cand->tick_source,
"Candidate TURN refresh", stun_timer_remainder (&cand->timer),
priv_turn_allocate_refresh_retransmissions_tick, cand);
break;
......@@ -838,7 +841,10 @@ static gboolean priv_turn_allocate_refresh_retransmissions_tick (gpointer pointe
}
agent_unlock_and_emit (cand->agent);
agent_unlock_and_emit (agent);
g_object_unref (agent);
return FALSE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment