summaryrefslogtreecommitdiff
path: root/src/transport/test_transport_api.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-01-27 13:21:36 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-01-27 13:21:36 +0000
commit8d27a7aa70365aa8c096ddf04671e4c30fadd5b2 (patch)
treec6a3c0e53883a1a0f79552e2e8086b858e5249e8 /src/transport/test_transport_api.c
parentb3fb754602fbf85a14fa3320dfc9b7ba1eb1d872 (diff)
fix memory leaks
Diffstat (limited to 'src/transport/test_transport_api.c')
-rw-r--r--src/transport/test_transport_api.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/transport/test_transport_api.c b/src/transport/test_transport_api.c
index 1058f2b6b..9ef5fc968 100644
--- a/src/transport/test_transport_api.c
+++ b/src/transport/test_transport_api.c
@@ -157,6 +157,7 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
"Peer %u (`%4s') received message of type %d and size %u size from peer %u (`%4s')!\n",
p->no, ps, ntohs (message->type), ntohs (message->size), t->no,
GNUNET_i2s (&t->id));
+ GNUNET_free (ps);
if ((MTYPE == ntohs (message->type)) &&
(sizeof (struct GNUNET_MessageHeader) == ntohs (message->size)))
@@ -266,6 +267,8 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
"Peer %u (`%4s'): peer (`%s') disconnected from me!\n", p->no, ps,
GNUNET_i2s (peer));
+ GNUNET_free (ps);
+
if (th != NULL)
GNUNET_TRANSPORT_notify_transmit_ready_cancel (th);
th = NULL;
@@ -304,6 +307,7 @@ start_cb (struct PeerContext *p, void *cls)
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Test tries to connect peer %u (`%s') -> peer %u (`%s')\n",
p1->no, sender_c, p2->no, GNUNET_i2s (&p2->id));
+ GNUNET_free (sender_c);
cc = GNUNET_TRANSPORT_TESTING_connect_peers (tth, p1, p2, &testing_connect_cb,
NULL);