gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r27563 - gnunet/src/mesh


From: gnunet
Subject: [GNUnet-SVN] r27563 - gnunet/src/mesh
Date: Tue, 25 Jun 2013 13:08:10 +0200

Author: bartpolot
Date: 2013-06-25 13:08:10 +0200 (Tue, 25 Jun 2013)
New Revision: 27563

Modified:
   gnunet/src/mesh/gnunet-service-mesh-new.c
Log:
- fix memleak

Modified: gnunet/src/mesh/gnunet-service-mesh-new.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh-new.c   2013-06-25 11:07:40 UTC (rev 
27562)
+++ gnunet/src/mesh/gnunet-service-mesh-new.c   2013-06-25 11:08:10 UTC (rev 
27563)
@@ -755,6 +755,16 @@
 tunnel_use_path (struct MeshTunnel *t, struct MeshPeerPath *p);
 
 /**
+ * Tunnel is empty: destroy it.
+ * 
+ * Notifies all participants (peers, cleints) about the destruction.
+ * 
+ * @param t Tunnel to destroy. 
+ */
+static void
+tunnel_destroy_empty (struct MeshTunnel *t);
+
+/**
  * @brief Queue and pass message to core when possible.
  * 
  * If type is payload (UNICAST, TO_ORIGIN, MULTICAST) checks for queue status
@@ -1285,6 +1295,7 @@
   struct GNUNET_PeerIdentity id;
   struct MeshPeerPath *p;
   struct MeshPeerPath *nextp;
+  unsigned int i;
 
   GNUNET_PEER_resolve (pi->id, &id);
   GNUNET_PEER_change_rc (pi->id, -1);
@@ -1308,6 +1319,9 @@
     path_destroy (p);
     p = nextp;
   }
+  for (i = 0; i < pi->ntunnels; i++)
+      tunnel_destroy_empty (pi->tunnels[i]);
+  GNUNET_array_grow (pi->tunnels, pi->ntunnels, 0);
   GNUNET_free (pi);
   return GNUNET_OK;
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]