From: Bart Polot Date: Fri, 30 Aug 2013 05:42:28 +0000 (+0000) Subject: - check hashmap for initialization X-Git-Tag: initial-import-from-subversion-38251~7598 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ed197cb4d272764d7b7d7d1479e1c13b8d4ce840;p=oweals%2Fgnunet.git - check hashmap for initialization --- diff --git a/src/mesh/gnunet-service-mesh-enc.c b/src/mesh/gnunet-service-mesh-enc.c index 99a01d701..0bb1a9712 100644 --- a/src/mesh/gnunet-service-mesh-enc.c +++ b/src/mesh/gnunet-service-mesh-enc.c @@ -3241,9 +3241,19 @@ tunnel_use_path (struct MeshTunnel2 *t, struct MeshPeerPath *p) } peer = connection_get_next_hop (c); + if (NULL == peer->connections) + { + connection_destroy (c); + return NULL; + } GNUNET_CONTAINER_multihashmap_put (peer->connections, &c->id, c, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST); peer = connection_get_prev_hop (c); + if (NULL == peer->connections) + { + connection_destroy (c); + return NULL; + } GNUNET_CONTAINER_multihashmap_put (peer->connections, &c->id, c, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST); return c;