Commit df2db74e authored by Olivier Crête's avatar Olivier Crête

discovery: Remove useless checks from discovery_add_local_host_candidate

parent be2706da
......@@ -465,7 +465,6 @@ NiceCandidate *discovery_add_local_host_candidate (
return NULL;
candidate = nice_candidate_new (NICE_CANDIDATE_TYPE_HOST);
if (candidate) {
candidate->stream_id = stream_id;
candidate->component_id = component_id;
candidate->addr = *address;
......@@ -498,23 +497,16 @@ NiceCandidate *discovery_add_local_host_candidate (
result = priv_add_local_candidate_pruned (component, candidate);
if (result == TRUE) {
GSList *modified_list = g_slist_append (component->sockets, udp_socket);
if (modified_list) {
/* success: store a pointer to the sockaddr */
component->sockets = modified_list;
component->sockets = g_slist_append (component->sockets, udp_socket);
agent_signal_new_candidate (agent, candidate);
} else { /* error: list memory allocation */
candidate = NULL; /* note: candidate already owned by component */
}
} else {
/* error: memory allocation, or duplicate candidates */
/* error: duplicate candidates */
errors = TRUE;
}
} else {
/* error: socket new */
errors = TRUE;
}
}
/* clean up after 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