Commit bdff4556 authored by Youness Alaoui's avatar Youness Alaoui

do not try to connect a tcp socket with no destination address to connect to....

do not try to connect a tcp socket with no destination address to connect to. Fixes coverity check when dereferencing addr
parent e73bfc64
......@@ -99,13 +99,13 @@ nice_tcp_bsd_socket_new (NiceAgent *agent, GMainContext *ctx, NiceAddress *addr)
NiceSocket *sock = g_slice_new0 (NiceSocket);
TcpPriv *priv;
if (addr != NULL) {
nice_address_copy_to_sockaddr(addr, (struct sockaddr *)&name);
} else {
memset (&name, 0, sizeof (name));
name.ss_family = AF_UNSPEC;
if (addr == NULL) {
/* We can't connect a tcp socket with no destination address */
return NULL;
}
nice_address_copy_to_sockaddr(addr, (struct sockaddr *)&name);
if ((sockfd == -1) &&
((name.ss_family == AF_UNSPEC) ||
(name.ss_family == AF_INET))) {
......
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