diff options
author | Olivier CrĂȘte <olivier.crete@collabora.co.uk> | 2010-05-20 22:42:29 -0400 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.co.uk> | 2010-05-21 14:45:04 -0400 |
commit | 469930053e26eeae6a0cd7a41595e619c4390e42 (patch) | |
tree | c870e5f6d79dae343e2d752d816018c87c4ba938 /socket/tcp-bsd.c | |
parent | 267c2b905831764acf9ae6cced8cd0d426f5f2c1 (diff) | |
download | libnice-469930053e26eeae6a0cd7a41595e619c4390e42.tar.gz |
tcp-bsd: Fix possible leak
Diffstat (limited to 'socket/tcp-bsd.c')
-rw-r--r-- | socket/tcp-bsd.c | 4 |
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) && |