Commit 46993005 authored by Olivier Crête's avatar Olivier Crête 👻

tcp-bsd: Fix possible leak

parent 267c2b90
......@@ -91,7 +91,7 @@ nice_tcp_bsd_socket_new (NiceAgent *agent, GMainContext *ctx, NiceAddress *addr)
int ret;
struct sockaddr_storage name;
guint name_len = sizeof (name);
NiceSocket *sock = g_slice_new0 (NiceSocket);
NiceSocket *sock;
TcpPriv *priv;
if (addr == NULL) {
......@@ -99,6 +99,8 @@ nice_tcp_bsd_socket_new (NiceAgent *agent, GMainContext *ctx, NiceAddress *addr)
return NULL;
}
sock = g_slice_new0 (NiceSocket);
nice_address_copy_to_sockaddr(addr, (struct sockaddr *)&name);
if ((sockfd == -1) &&
......
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