diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-12-19 21:47:34 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-12-19 21:47:34 +0000 |
commit | 506926e9bded251ec9073097c8ab2f87553e0650 (patch) | |
tree | a74e7517e798a9e3e541510d31478d61427bd222 /src/social | |
parent | cc1dfaf41624ea34094b1f2d4aab43591e2d61e7 (diff) | |
download | gnunet-506926e9bded251ec9073097c8ab2f87553e0650.tar.gz gnunet-506926e9bded251ec9073097c8ab2f87553e0650.zip |
-fix leaks
Diffstat (limited to 'src/social')
-rw-r--r-- | src/social/gnunet-service-social.c | 9 | ||||
-rw-r--r-- | src/social/social_api.c | 9 | ||||
-rw-r--r-- | src/social/test_social.c | 8 |
3 files changed, 16 insertions, 10 deletions
diff --git a/src/social/gnunet-service-social.c b/src/social/gnunet-service-social.c index d297a153b..1fdb0ecb4 100644 --- a/src/social/gnunet-service-social.c +++ b/src/social/gnunet-service-social.c | |||
@@ -690,6 +690,7 @@ client_recv_guest_enter (void *cls, struct GNUNET_SERVER_Client *client, | |||
690 | sizeof (*req), relay_size, join_msg_size, req_size); | 690 | sizeof (*req), relay_size, join_msg_size, req_size); |
691 | GNUNET_break (0); | 691 | GNUNET_break (0); |
692 | GNUNET_SERVER_client_disconnect (client); | 692 | GNUNET_SERVER_client_disconnect (client); |
693 | GNUNET_free (gst); | ||
693 | return; | 694 | return; |
694 | } | 695 | } |
695 | if (0 < gst->relay_count) | 696 | if (0 < gst->relay_count) |
@@ -707,12 +708,12 @@ client_recv_guest_enter (void *cls, struct GNUNET_SERVER_Client *client, | |||
707 | if (NULL == plc_gst) | 708 | if (NULL == plc_gst) |
708 | { | 709 | { |
709 | plc_gst = GNUNET_CONTAINER_multihashmap_create (1, GNUNET_YES); | 710 | plc_gst = GNUNET_CONTAINER_multihashmap_create (1, GNUNET_YES); |
710 | GNUNET_CONTAINER_multihashmap_put (place_guests, &plc->pub_key_hash, plc_gst, | 711 | (void) GNUNET_CONTAINER_multihashmap_put (place_guests, &plc->pub_key_hash, plc_gst, |
711 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST); | 712 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST); |
712 | } | 713 | } |
713 | GNUNET_CONTAINER_multihashmap_put (plc_gst, &gst->pub_key_hash, plc, | 714 | (void) GNUNET_CONTAINER_multihashmap_put (plc_gst, &gst->pub_key_hash, gst, |
714 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST); | 715 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST); |
715 | GNUNET_CONTAINER_multihashmap_put (guests, &plc->pub_key_hash, plc, | 716 | (void) GNUNET_CONTAINER_multihashmap_put (guests, &plc->pub_key_hash, gst, |
716 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); | 717 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); |
717 | gst->slave | 718 | gst->slave |
718 | = GNUNET_PSYC_slave_join (cfg, &plc->pub_key, &gst->priv_key, | 719 | = GNUNET_PSYC_slave_join (cfg, &plc->pub_key, &gst->priv_key, |
diff --git a/src/social/social_api.c b/src/social/social_api.c index dfcf18883..db6a467cb 100644 --- a/src/social/social_api.c +++ b/src/social/social_api.c | |||
@@ -661,10 +661,11 @@ host_recv_enter_request (void *cls, | |||
661 | struct GNUNET_ENV_Environment *env = NULL; | 661 | struct GNUNET_ENV_Environment *env = NULL; |
662 | const void *data = NULL; | 662 | const void *data = NULL; |
663 | uint16_t data_size = 0; | 663 | uint16_t data_size = 0; |
664 | 664 | char *str; | |
665 | const struct GNUNET_PSYC_JoinRequestMessage * | 665 | const struct GNUNET_PSYC_JoinRequestMessage * |
666 | req = (const struct GNUNET_PSYC_JoinRequestMessage *) msg; | 666 | req = (const struct GNUNET_PSYC_JoinRequestMessage *) msg; |
667 | const struct GNUNET_PSYC_Message *entry_msg = NULL; | 667 | const struct GNUNET_PSYC_Message *entry_msg = NULL; |
668 | |||
668 | if (sizeof (*req) + sizeof (*entry_msg) <= ntohs (req->header.size)) | 669 | if (sizeof (*req) + sizeof (*entry_msg) <= ntohs (req->header.size)) |
669 | { | 670 | { |
670 | entry_msg = (struct GNUNET_PSYC_Message *) &req[1]; | 671 | entry_msg = (struct GNUNET_PSYC_Message *) &req[1]; |
@@ -676,10 +677,12 @@ host_recv_enter_request (void *cls, | |||
676 | if (GNUNET_OK != GNUNET_PSYC_message_parse (entry_msg, &method_name, env, | 677 | if (GNUNET_OK != GNUNET_PSYC_message_parse (entry_msg, &method_name, env, |
677 | &data, &data_size)) | 678 | &data, &data_size)) |
678 | { | 679 | { |
680 | GNUNET_break_op (0); | ||
681 | str = GNUNET_CRYPTO_ecdsa_public_key_to_string (&req->slave_key); | ||
679 | LOG (GNUNET_ERROR_TYPE_WARNING, | 682 | LOG (GNUNET_ERROR_TYPE_WARNING, |
680 | "Ignoring invalid entry request from nym %s.\n", | 683 | "Ignoring invalid entry request from nym %s.\n", |
681 | GNUNET_CRYPTO_ecdsa_public_key_to_string (&req->slave_key)); | 684 | str); |
682 | GNUNET_break_op (0); | 685 | GNUNET_free (str); |
683 | GNUNET_ENV_environment_destroy (env); | 686 | GNUNET_ENV_environment_destroy (env); |
684 | return; | 687 | return; |
685 | } | 688 | } |
diff --git a/src/social/test_social.c b/src/social/test_social.c index d7a407c1a..ce4714651 100644 --- a/src/social/test_social.c +++ b/src/social/test_social.c | |||
@@ -293,12 +293,14 @@ host_farewell (void *cls, | |||
293 | struct GNUNET_ENV_Modifier *variables) | 293 | struct GNUNET_ENV_Modifier *variables) |
294 | { | 294 | { |
295 | // FIXME: this function is not called yet | 295 | // FIXME: this function is not called yet |
296 | struct GNUNET_CRYPTO_EcdsaPublicKey *nym_key = GNUNET_SOCIAL_nym_get_key (nym); | ||
297 | char *str; | ||
296 | 298 | ||
297 | struct GNUNET_CRYPTO_EcdsaPublicKey * | 299 | str = GNUNET_CRYPTO_ecdsa_public_key_to_string (nym_key); |
298 | nym_key = GNUNET_SOCIAL_nym_get_key (nym); | ||
299 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 300 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
300 | "Nym %s has left the place.\n", | 301 | "Nym %s has left the place.\n", |
301 | GNUNET_CRYPTO_ecdsa_public_key_to_string (nym_key)); | 302 | str); |
303 | GNUNET_free (str); | ||
302 | GNUNET_assert (0 == memcmp (&guest_pub_key, nym_key, sizeof (*nym_key))); | 304 | GNUNET_assert (0 == memcmp (&guest_pub_key, nym_key, sizeof (*nym_key))); |
303 | 305 | ||
304 | GNUNET_SCHEDULER_add_now (&schedule_host_leave, NULL); | 306 | GNUNET_SCHEDULER_add_now (&schedule_host_leave, NULL); |