aboutsummaryrefslogtreecommitdiff
path: root/src/mesh
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2011-10-28 16:41:02 +0000
committerBart Polot <bart@net.in.tum.de>2011-10-28 16:41:02 +0000
commit53edf5e34cbe0b24fa448770fa07c7580d2bfbff (patch)
treeafe33de83747f0ddbe862c77f396503bfd7e6c82 /src/mesh
parent184e8fa34b2ed62edb3459462ba6fde2018eaf1a (diff)
downloadgnunet-53edf5e34cbe0b24fa448770fa07c7580d2bfbff.tar.gz
gnunet-53edf5e34cbe0b24fa448770fa07c7580d2bfbff.zip
Fixed a memory leak
Diffstat (limited to 'src/mesh')
-rw-r--r--src/mesh/mesh_tunnel_tree.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mesh/mesh_tunnel_tree.c b/src/mesh/mesh_tunnel_tree.c
index c58260601..a01ff2ca7 100644
--- a/src/mesh/mesh_tunnel_tree.c
+++ b/src/mesh/mesh_tunnel_tree.c
@@ -403,14 +403,17 @@ tree_update_first_hops (struct MeshTunnelTree *tree,
403 hop = &pi; 403 hop = &pi;
404 GNUNET_PEER_resolve(old->peer, hop); 404 GNUNET_PEER_resolve(old->peer, hop);
405 } 405 }
406 copy = GNUNET_malloc(sizeof(struct GNUNET_PeerIdentity));
407 *copy = *hop;
408 GNUNET_PEER_resolve(parent->peer, &id); 406 GNUNET_PEER_resolve(parent->peer, &id);
407 copy = GNUNET_CONTAINER_multihashmap_get (tree->first_hops, &id.hashPubKey);
408 if (NULL == copy)
409 copy = GNUNET_malloc(sizeof(struct GNUNET_PeerIdentity));
410 *copy = *hop;
411
409 GNUNET_CONTAINER_multihashmap_put( 412 GNUNET_CONTAINER_multihashmap_put(
410 tree->first_hops, 413 tree->first_hops,
411 &id.hashPubKey, 414 &id.hashPubKey,
412 copy, 415 copy,
413 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST); 416 GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE);
414 417
415 for (n = parent->children_head; NULL != n; n = n->next) 418 for (n = parent->children_head; NULL != n; n = n->next)
416 { 419 {