aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mesh/mesh_tunnel_tree.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mesh/mesh_tunnel_tree.c b/src/mesh/mesh_tunnel_tree.c
index cfe6a46a80..63f5aef588 100644
--- a/src/mesh/mesh_tunnel_tree.c
+++ b/src/mesh/mesh_tunnel_tree.c
@@ -269,7 +269,7 @@ path_destroy (struct MeshPeerPath *p)
if (NULL == p)
return GNUNET_OK;
GNUNET_PEER_decrement_rcs (p->peers, p->length);
- GNUNET_free (p->peers);
+ GNUNET_free_non_null (p->peers);
GNUNET_free (p);
return GNUNET_OK;
}
@@ -760,7 +760,10 @@ tree_get_path_to_peer (struct MeshTunnelTree *t, GNUNET_PEER_Id peer)
GNUNET_PEER_change_rc (n->peer, 1);
n = n->parent;
if (NULL == n)
+ {
+ path_destroy (p);
return NULL;
+ }
}
GNUNET_array_append (p->peers, p->length, myid);
GNUNET_PEER_change_rc (myid, 1);