summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTimothy Redaelli <timothy@redaelli.eu>2011-03-31 18:11:54 +0200
committerYouness Alaoui <youness.alaoui@collabora.co.uk>2011-03-31 19:22:51 -0400
commit6816d2d52a95116c416e722636f0cbfa8923ffde (patch)
tree10cd1c7be28bc339c5ff2d942c6ff9435e9046e3 /tests
parent17f2117b49aecf015f54d4443617da89f7d684d6 (diff)
downloadlibnice-6816d2d52a95116c416e722636f0cbfa8923ffde.tar.gz
Fix a (possible) memory leak in nice_turn_socket_new and in a test
Diffstat (limited to 'tests')
-rw-r--r--tests/test-pseudotcp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/test-pseudotcp.c b/tests/test-pseudotcp.c
index 92cec3f..363fcde 100644
--- a/tests/test-pseudotcp.c
+++ b/tests/test-pseudotcp.c
@@ -174,7 +174,7 @@ static gboolean notify_packet (gpointer user_data)
static PseudoTcpWriteResult write (PseudoTcpSocket *sock,
const gchar *buffer, guint32 len, gpointer user_data)
{
- struct notify_data *data = g_new0 (struct notify_data,1);
+ struct notify_data *data;
PseudoTcpState state;
int drop_rate = rand () % 100;
g_object_get (sock, "state", &state, NULL);
@@ -184,6 +184,8 @@ static PseudoTcpWriteResult write (PseudoTcpSocket *sock,
return WR_SUCCESS;
}
+ data = g_new0 (struct notify_data,1);
+
g_debug ("Socket %p(%d) Writing : %d bytes", sock, state, len);
data->buffer = g_malloc (len);