summaryrefslogtreecommitdiff
path: root/socket/tcp-bsd.c
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.co.uk>2010-05-20 22:42:29 -0400
committerOlivier CrĂȘte <olivier.crete@collabora.co.uk>2010-05-21 14:45:04 -0400
commit469930053e26eeae6a0cd7a41595e619c4390e42 (patch)
treec870e5f6d79dae343e2d752d816018c87c4ba938 /socket/tcp-bsd.c
parent267c2b905831764acf9ae6cced8cd0d426f5f2c1 (diff)
downloadlibnice-469930053e26eeae6a0cd7a41595e619c4390e42.tar.gz
tcp-bsd: Fix possible leak
Diffstat (limited to 'socket/tcp-bsd.c')
-rw-r--r--socket/tcp-bsd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/socket/tcp-bsd.c b/socket/tcp-bsd.c
index bcc87be..1018430 100644
--- a/socket/tcp-bsd.c
+++ b/socket/tcp-bsd.c
@@ -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) &&