- make sure to free all peer_rc on error
authorBart Polot <bart@net.in.tum.de>
Tue, 25 Jun 2013 15:20:28 +0000 (15:20 +0000)
committerBart Polot <bart@net.in.tum.de>
Tue, 25 Jun 2013 15:20:28 +0000 (15:20 +0000)
src/mesh/gnunet-service-mesh-new.c

index 0634693423f9dc31ee9f37c97deeb166bf686adb..ce2579b903b74d76010b4672569adf1a8e75ec4b 100644 (file)
@@ -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;
   }