From: Bart Polot Date: Tue, 25 Jun 2013 15:20:28 +0000 (+0000) Subject: - make sure to free all peer_rc on error X-Git-Tag: initial-import-from-subversion-38251~8643 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=28c4cdc431b8ec7321d067866eda16c420c179e1;p=oweals%2Fgnunet.git - make sure to free all peer_rc on error --- 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; }