fixing leaks
authorChristian Grothoff <christian@grothoff.org>
Tue, 2 Feb 2010 13:14:54 +0000 (13:14 +0000)
committerChristian Grothoff <christian@grothoff.org>
Tue, 2 Feb 2010 13:14:54 +0000 (13:14 +0000)
src/transport/gnunet-service-transport.c
src/transport/transport_api.c

index 81945c5118c5af02d83ad3f4fda4660897b16b0f..6fb1f0b38069ae420c52b9aaf2d38a02ab712f71 100644 (file)
@@ -1710,7 +1710,7 @@ handle_pong (void *cls, const struct GNUNET_MessageHeader *message,
   struct ValidationList *pos;
   struct ValidationAddress *va;
   struct GNUNET_PeerIdentity id;
-  struct TransportPongMessage *pong = (struct TransportPongMessage *)message;
+  const struct TransportPongMessage *pong = (const struct TransportPongMessage *)message;
   int count = 0;
   unsigned int challenge = ntohl(pong->challenge);
   pos = pending_validations;
@@ -2335,7 +2335,6 @@ static int handle_ping(void *cls, const struct GNUNET_MessageHeader *message,
   struct PeerAddressList *peer_address;
   uint16_t msize;
   struct NeighborList *n;
-  pong = GNUNET_malloc(sizeof(struct TransportPongMessage));
 
 #if DEBUG_TRANSPORT
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK,
index bd9e11270e92ee9cd8b327b03bdafbacd912affc..347842e5258892d7f9b800b43c117bcfcd6b4ed4 100644 (file)
@@ -1623,7 +1623,7 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg)
                   "Receiving `%s' message for `%4s'.\n",
                   "CONNECT", GNUNET_i2s (&cim->id));
 #endif
-      if (find_neighbour(h, &cim->id) == NULL)
+      if (NULL == (n = find_neighbour(h, &cim->id)))
         {
 #if DEBUG_TRANSPORT
               GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1636,11 +1636,10 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg)
       else
         {
 #if DEBUG_TRANSPORT
-              GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                          "Do know neighbor, scheduling transmission!\n");
+         GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                     "Do know neighbor, scheduling transmission!\n");
 #endif
-          n = find_neighbour(h, &cim->id);
-          n->received_ack = GNUNET_YES;
+         n->received_ack = GNUNET_YES;
           if (NULL != n->transmit_handle)
             {
 #if DEBUG_TRANSPORT