Commit 231943d2 authored by Olivier Crête's avatar Olivier Crête

discovery: Remove useless checks from discovery_add_relay_candidate

parent df2db74e
...@@ -602,7 +602,7 @@ discovery_add_relay_candidate ( ...@@ -602,7 +602,7 @@ discovery_add_relay_candidate (
return NULL; return NULL;
candidate = nice_candidate_new (NICE_CANDIDATE_TYPE_RELAYED); candidate = nice_candidate_new (NICE_CANDIDATE_TYPE_RELAYED);
if (candidate) {
if (agent->compatibility == NICE_COMPATIBILITY_GOOGLE) { if (agent->compatibility == NICE_COMPATIBILITY_GOOGLE) {
candidate->priority = nice_candidate_jingle_priority (candidate); candidate->priority = nice_candidate_jingle_priority (candidate);
} else if (agent->compatibility == NICE_COMPATIBILITY_MSN) { } else if (agent->compatibility == NICE_COMPATIBILITY_MSN) {
...@@ -637,24 +637,16 @@ discovery_add_relay_candidate ( ...@@ -637,24 +637,16 @@ discovery_add_relay_candidate (
result = priv_add_local_candidate_pruned (component, candidate); result = priv_add_local_candidate_pruned (component, candidate);
if (result) { if (result) {
GSList *modified_list = g_slist_append (component->sockets, relay_socket); component->sockets = g_slist_append (component->sockets, relay_socket);
if (modified_list) {
/* success: store a pointer to the sockaddr */
component->sockets = modified_list;
}
agent_signal_new_candidate (agent, candidate); agent_signal_new_candidate (agent, candidate);
} else { } else {
/* error: memory allocation, or duplicate candidate */ /* error: duplicate candidate */
errors = TRUE; errors = TRUE;
} }
} else { } else {
/* error: socket factory make */ /* error: socket factory make */
errors = TRUE; errors = TRUE;
} }
} else {
/* error: udp socket memory allocation */
errors = TRUE;
}
/* clean up after errors */ /* clean up after errors */
if (errors) { if (errors) {
......
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