diff options
author | lurchi <lurchi@strangeplace.net> | 2018-01-07 00:59:40 +0100 |
---|---|---|
committer | lurchi <lurchi@strangeplace.net> | 2018-01-07 00:59:40 +0100 |
commit | 1522c35f31166008edec5a3ac341d80626792e42 (patch) | |
tree | 5c0b740dd4b1b95201de71a42ba96670edee40d2 /src/social/gnunet-service-social.c | |
parent | 9510456139e319cadef5c8f2b5279c9bc31c5f5c (diff) |
shutdown might happen when plc_gst is not in the hashmap
Diffstat (limited to 'src/social/gnunet-service-social.c')
-rw-r--r-- | src/social/gnunet-service-social.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/social/gnunet-service-social.c b/src/social/gnunet-service-social.c index d1e6448129..520df20b96 100644 --- a/src/social/gnunet-service-social.c +++ b/src/social/gnunet-service-social.c @@ -503,17 +503,18 @@ cleanup_guest (struct Guest *gst) struct GNUNET_CONTAINER_MultiHashMap * plc_gst = GNUNET_CONTAINER_multihashmap_get (place_guests, &plc->pub_key_hash); - GNUNET_assert (NULL != plc_gst); - GNUNET_CONTAINER_multihashmap_remove (plc_gst, &plc->ego_pub_hash, gst); - - if (0 == GNUNET_CONTAINER_multihashmap_size (plc_gst)) + if (NULL != plc_gst) { - GNUNET_CONTAINER_multihashmap_remove (place_guests, &plc->pub_key_hash, - plc_gst); - GNUNET_CONTAINER_multihashmap_destroy (plc_gst); + GNUNET_CONTAINER_multihashmap_remove (plc_gst, &plc->ego_pub_hash, gst); + + if (0 == GNUNET_CONTAINER_multihashmap_size (plc_gst)) + { + GNUNET_CONTAINER_multihashmap_remove (place_guests, &plc->pub_key_hash, + plc_gst); + GNUNET_CONTAINER_multihashmap_destroy (plc_gst); + } } GNUNET_CONTAINER_multihashmap_remove (guests, &plc->pub_key_hash, gst); - if (NULL != gst->join_req) GNUNET_free (gst->join_req); if (NULL != gst->relays) @@ -1869,6 +1870,7 @@ guest_enter (const struct GuestEnterRequest *greq, struct Guest **ret_gst) ret = GNUNET_YES; } + // TODO: explain why free(gst) not necessary if (NULL != ret_gst) *ret_gst = gst; return ret; |