Fixed a memory leak when receiving a second create path for the same tunnel
[oweals/gnunet.git] / src / mesh / gnunet-service-mesh.c
index a8b132d7a11f1ba1e1ddd9933c69407ad8bf1a8e..9d3784567842a9832f81a28a154b59061c3e334b 100644 (file)
@@ -2530,7 +2530,8 @@ handle_mesh_path_create (void *cls, const struct GNUNET_PeerIdentity *peer,
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "MESH:   It's for us!\n");
     path_add_to_origin (orig_peer_info, path);
-    t->peers = GNUNET_CONTAINER_multihashmap_create(4);
+    if (NULL == t->peers)
+      t->peers = GNUNET_CONTAINER_multihashmap_create(4);
     GNUNET_break (GNUNET_OK == GNUNET_CONTAINER_multihashmap_put (
         t->peers,
         &my_full_id.hashPubKey,