- fix segfault
authorBart Polot <bart@net.in.tum.de>
Thu, 14 Feb 2013 13:02:09 +0000 (13:02 +0000)
committerBart Polot <bart@net.in.tum.de>
Thu, 14 Feb 2013 13:02:09 +0000 (13:02 +0000)
src/mesh/gnunet-service-mesh.c

index 673ea81b515684c395474f1839373337ad6a97a6..3dc36875b33c5326ecb7deacf1c7c8e0f1d0a851 100644 (file)
@@ -2026,7 +2026,9 @@ peer_info_delete_tunnel (void *cls, const struct GNUNET_HashCode * key, void *va
     {
       peer->ntunnels--;
       peer->tunnels[i] = peer->tunnels[peer->ntunnels];
-      peer->tunnels = GNUNET_realloc (peer->tunnels, peer->ntunnels);
+      peer->tunnels = 
+        GNUNET_realloc (peer->tunnels, 
+                        peer->ntunnels * sizeof(struct MeshTunnel *));
       return GNUNET_YES;
     }
   }