fix memory leaks
authorMatthias Wachs <wachs@net.in.tum.de>
Fri, 27 Jan 2012 13:21:36 +0000 (13:21 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Fri, 27 Jan 2012 13:21:36 +0000 (13:21 +0000)
src/transport/test_transport_api.c

index 1058f2b6b3096f372ab33e33a0d3025406c208d3..9ef5fc9689acf0466ac7c87fb5a58849c08cc1a8 100644 (file)
@@ -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);