From 28c4cdc431b8ec7321d067866eda16c420c179e1 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Tue, 25 Jun 2013 15:20:28 +0000 Subject: [PATCH] - make sure to free all peer_rc on error --- src/mesh/gnunet-service-mesh-new.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesh/gnunet-service-mesh-new.c b/src/mesh/gnunet-service-mesh-new.c index 063469342..ce2579b90 100644 --- a/src/mesh/gnunet-service-mesh-new.c +++ b/src/mesh/gnunet-service-mesh-new.c @@ -1415,7 +1415,7 @@ peer_info_add_path (struct MeshPeerInfo *peer_info, struct MeshPeerPath *path, path_destroy (path); return; } - if (path->length <= 2 && GNUNET_NO == trusted) + if (2 >= path->length && GNUNET_NO == trusted) { /* Only allow CORE to tell us about direct paths */ path_destroy (path); @@ -1446,9 +1446,9 @@ peer_info_add_path (struct MeshPeerInfo *peer_info, struct MeshPeerPath *path, } #endif l = path_get_length (path); - if (0 == l) + if (2 >= l) { - GNUNET_free (path); + path_destroy (path); return; } -- 2.25.1