cppcheck
authorMatthias Wachs <wachs@net.in.tum.de>
Thu, 26 Jan 2012 13:23:49 +0000 (13:23 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Thu, 26 Jan 2012 13:23:49 +0000 (13:23 +0000)
src/ats/ats_api.c
src/ats/gnunet-service-ats_addresses_mlp.c

index 7c0fb2d320ab54d18f9c47b43c3d7cad44c35ab8..82eede9dc1e9907109045f0e60f91f458700fd4c 100644 (file)
@@ -252,14 +252,6 @@ suggest_address (void *cls, const GNUNET_HashCode * key, void *value)
   return GNUNET_NO;
 }
 
-
-int
-map_it (void *cls, const GNUNET_HashCode * key, void *value)
-{
-  LOG (GNUNET_ERROR_TYPE_DEBUG, "Found entry for %s\n", GNUNET_h2s (key));
-  return GNUNET_YES;
-}
-
 /**
  * We would like to establish a new connection with a peer.
  * ATS should suggest a good address to begin with.
index 3c57110f55efe094beec85825f5963405d6666b6..602925e1f5ab3b0a954d243b4455bae9207bead0 100644 (file)
@@ -1418,6 +1418,8 @@ GAS_mlp_done (struct GAS_MLP_Handle *mlp)
   struct ATS_Peer * peer;
   struct ATS_Peer * tmp;
 
+  GNUNET_assert (mlp != NULL);
+
   if (mlp->mlp_task != GNUNET_SCHEDULER_NO_TASK)
   {
     GNUNET_SCHEDULER_cancel(mlp->mlp_task);
@@ -1425,16 +1427,13 @@ GAS_mlp_done (struct GAS_MLP_Handle *mlp)
   }
 
   /* clean up peer list */
-  if (mlp != NULL)
+  peer = mlp->peer_head;
+  while (peer != NULL)
   {
-    peer = mlp->peer_head;
-    while (peer != NULL)
-    {
-      GNUNET_CONTAINER_DLL_remove(mlp->peer_head, mlp->peer_tail, peer);
-      tmp = peer->next;
-      GNUNET_free (peer);
-      peer = tmp;
-    }
+    GNUNET_CONTAINER_DLL_remove(mlp->peer_head, mlp->peer_tail, peer);
+    tmp = peer->next;
+    GNUNET_free (peer);
+    peer = tmp;
   }
   mlp_delete_problem (mlp);