Small fix, improved comment
[oweals/gnunet.git] / src / mesh / gnunet-service-mesh.c
index 312ff5a8ac9f63cea1b33d11314c45b75877139b..e3a8b3f0e2f968af64671fcf6a816fc1d64c9dc2 100644 (file)
@@ -1158,6 +1158,7 @@ send_message (const struct GNUNET_MessageHeader *message,
   if (NULL == p)
   {
     GNUNET_break (0);
+    GNUNET_free (info);
     return;
   }
   i = peer_info_transmit_slot (neighbor);
@@ -1448,6 +1449,7 @@ peer_info_remove_path (struct MeshPeerInfo *peer, GNUNET_PEER_Id p1,
   for (i = 0; i < peer->ntunnels; i++)
   {
     d = tunnel_notify_connection_broken (peer->tunnels[i], p1, p2);
+    if (0 == d) continue;
     /* TODO
      * Problem: one or more peers have been deleted from the tunnel tree.
      * We don't know who they are to try to add them again.
@@ -1472,7 +1474,9 @@ peer_info_remove_path (struct MeshPeerInfo *peer, GNUNET_PEER_Id p1,
     }
     if (NULL != aux)
     {
-      /* No callback, as peer will be already disconnected */
+      /* No callback, as peer will be already disconnected and a connection
+       * scheduled by tunnel_notify_connection_broken.
+       */
       tree_add_path (peer->tunnels[i]->tree, aux, NULL, NULL);
     }
     else