aboutsummaryrefslogtreecommitdiff
path: root/src/mesh/mesh_tunnel_tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesh/mesh_tunnel_tree.c')
-rw-r--r--src/mesh/mesh_tunnel_tree.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mesh/mesh_tunnel_tree.c b/src/mesh/mesh_tunnel_tree.c
index c2fe6c3d9..48d052ef7 100644
--- a/src/mesh/mesh_tunnel_tree.c
+++ b/src/mesh/mesh_tunnel_tree.c
@@ -119,7 +119,7 @@ path_new (unsigned int length)
119{ 119{
120 struct MeshPeerPath *p; 120 struct MeshPeerPath *p;
121 121
122 p = GNUNET_malloc (sizeof (struct MeshPeerPath)); 122 p = GNUNET_new (struct MeshPeerPath);
123 if (length > 0) 123 if (length > 0)
124 { 124 {
125 p->length = length; 125 p->length = length;
@@ -233,7 +233,7 @@ tree_node_new (struct MeshTunnelTreeNode *parent, GNUNET_PEER_Id peer)
233{ 233{
234 struct MeshTunnelTreeNode *node; 234 struct MeshTunnelTreeNode *node;
235 235
236 node = GNUNET_malloc (sizeof (struct MeshTunnelTreeNode)); 236 node = GNUNET_new (struct MeshTunnelTreeNode);
237 node->peer = peer; 237 node->peer = peer;
238 GNUNET_PEER_change_rc (peer, 1); 238 GNUNET_PEER_change_rc (peer, 1);
239 node->parent = parent; 239 node->parent = parent;
@@ -322,7 +322,7 @@ tree_node_update_first_hops (struct MeshTunnelTree *tree,
322 GNUNET_PEER_resolve (parent->peer, &id); 322 GNUNET_PEER_resolve (parent->peer, &id);
323 copy = GNUNET_CONTAINER_multihashmap_get (tree->first_hops, &id.hashPubKey); 323 copy = GNUNET_CONTAINER_multihashmap_get (tree->first_hops, &id.hashPubKey);
324 if (NULL == copy) 324 if (NULL == copy)
325 copy = GNUNET_malloc (sizeof (struct GNUNET_PeerIdentity)); 325 copy = GNUNET_new (struct GNUNET_PeerIdentity);
326 *copy = *hop; 326 *copy = *hop;
327 327
328 (void) GNUNET_CONTAINER_multihashmap_put (tree->first_hops, &id.hashPubKey, 328 (void) GNUNET_CONTAINER_multihashmap_put (tree->first_hops, &id.hashPubKey,
@@ -417,7 +417,7 @@ tree_new (GNUNET_PEER_Id peer)
417{ 417{
418 struct MeshTunnelTree *tree; 418 struct MeshTunnelTree *tree;
419 419
420 tree = GNUNET_malloc (sizeof (struct MeshTunnelTree)); 420 tree = GNUNET_new (struct MeshTunnelTree);
421 tree->first_hops = GNUNET_CONTAINER_multihashmap_create (32, GNUNET_NO); 421 tree->first_hops = GNUNET_CONTAINER_multihashmap_create (32, GNUNET_NO);
422 tree->root = tree_node_new (NULL, peer); 422 tree->root = tree_node_new (NULL, peer);
423 tree->root->status = MESH_PEER_ROOT; 423 tree->root->status = MESH_PEER_ROOT;
@@ -647,7 +647,7 @@ tree_iterate_all (struct MeshTunnelTree *tree,
647 struct MeshTreePendingNode *pending; 647 struct MeshTreePendingNode *pending;
648 648
649 cb (cb_cls, tree->root->peer, 0); 649 cb (cb_cls, tree->root->peer, 0);
650 pending = GNUNET_malloc (sizeof (struct MeshTreePendingNode)); 650 pending = GNUNET_new (struct MeshTreePendingNode);
651 pending->node = tree->root; 651 pending->node = tree->root;
652 head = tail = NULL; 652 head = tail = NULL;
653 GNUNET_CONTAINER_DLL_insert (head, tail, pending); 653 GNUNET_CONTAINER_DLL_insert (head, tail, pending);
@@ -661,7 +661,7 @@ tree_iterate_all (struct MeshTunnelTree *tree,
661 for (n = parent->children_head; NULL != n; n = n->next) 661 for (n = parent->children_head; NULL != n; n = n->next)
662 { 662 {
663 cb (cb_cls, n->peer, parent->peer); 663 cb (cb_cls, n->peer, parent->peer);
664 pending = GNUNET_malloc (sizeof (struct MeshTreePendingNode)); 664 pending = GNUNET_new (struct MeshTreePendingNode);
665 pending->node = n; 665 pending->node = n;
666 /* Insert_tail: breadth first, Insert: depth first */ 666 /* Insert_tail: breadth first, Insert: depth first */
667 GNUNET_CONTAINER_DLL_insert (head, tail, pending); 667 GNUNET_CONTAINER_DLL_insert (head, tail, pending);