aboutsummaryrefslogtreecommitdiff
path: root/src/social/gnunet-service-social.c
diff options
context:
space:
mode:
authoranryko <a.shvenke@gmail.com>2018-01-04 19:29:49 +0100
committeranryko <a.shvenke@gmail.com>2018-01-04 19:29:49 +0100
commit6c1432bf5a9623917aed5d150e438e59baec9490 (patch)
tree1e5439804096460e913852d45e40ae6c64b4e1fb /src/social/gnunet-service-social.c
parente7e3572182bf2a0d51ae449abeee0fabbb18a0b4 (diff)
Leak fix.
Diffstat (limited to 'src/social/gnunet-service-social.c')
-rw-r--r--src/social/gnunet-service-social.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/social/gnunet-service-social.c b/src/social/gnunet-service-social.c
index 5b2a8ba9ba..d1e6448129 100644
--- a/src/social/gnunet-service-social.c
+++ b/src/social/gnunet-service-social.c
@@ -1755,6 +1755,7 @@ guest_enter (const struct GuestEnterRequest *greq, struct Guest **ret_gst)
struct GNUNET_CONTAINER_MultiHashMap *
plc_gst = GNUNET_CONTAINER_multihashmap_get (place_guests, &place_pub_hash);
struct Guest *gst = NULL;
+ int new_guest;
if (NULL != plc_gst)
gst = GNUNET_CONTAINER_multihashmap_get (plc_gst, &ego_pub_hash);
@@ -1763,9 +1764,12 @@ guest_enter (const struct GuestEnterRequest *greq, struct Guest **ret_gst)
"plc_gst = %p, gst = %p\n",
plc_gst,
gst);
+
+ new_guest = GNUNET_NO;
if (NULL == gst)
{
gst = GNUNET_new (struct Guest);
+ new_guest = GNUNET_YES;
}
if (NULL == gst->slave)
{
@@ -1841,6 +1845,9 @@ guest_enter (const struct GuestEnterRequest *greq, struct Guest **ret_gst)
plc_gst = GNUNET_CONTAINER_multihashmap_create (1, GNUNET_YES);
(void) GNUNET_CONTAINER_multihashmap_put (place_guests, &plc->pub_key_hash, plc_gst,
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST);
+ }
+ if (GNUNET_YES == new_guest)
+ {
(void) GNUNET_CONTAINER_multihashmap_put (plc_gst, &plc->ego_pub_hash, gst,
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST);
(void) GNUNET_CONTAINER_multihashmap_put (guests, &plc->pub_key_hash, gst,