diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2012-11-02 15:52:22 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2012-11-02 15:52:22 +0000 |
commit | d0b4927e6ab7e8b9874dd7807055e77fb4c5163f (patch) | |
tree | a7da47f8e1eb722e4d40475702a64aa9bc4932c2 /src/testbed | |
parent | 7d60e3ca70833dc6882afabf5ed1519da819192f (diff) | |
download | gnunet-d0b4927e6ab7e8b9874dd7807055e77fb4c5163f.tar.gz gnunet-d0b4927e6ab7e8b9874dd7807055e77fb4c5163f.zip |
fix memleak
Diffstat (limited to 'src/testbed')
-rw-r--r-- | src/testbed/gnunet-service-testbed.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/testbed/gnunet-service-testbed.c b/src/testbed/gnunet-service-testbed.c index ec3e000ee..c9b7c930a 100644 --- a/src/testbed/gnunet-service-testbed.c +++ b/src/testbed/gnunet-service-testbed.c | |||
@@ -1803,6 +1803,7 @@ handle_init (void *cls, struct GNUNET_SERVER_Client *client, | |||
1803 | return; | 1803 | return; |
1804 | } | 1804 | } |
1805 | master_context = GNUNET_malloc (sizeof (struct Context)); | 1805 | master_context = GNUNET_malloc (sizeof (struct Context)); |
1806 | GNUNET_SERVER_client_keep (client); | ||
1806 | master_context->client = client; | 1807 | master_context->client = client; |
1807 | master_context->host_id = ntohl (msg->host_id); | 1808 | master_context->host_id = ntohl (msg->host_id); |
1808 | master_context->master_ip = GNUNET_strdup (controller_hostname); | 1809 | master_context->master_ip = GNUNET_strdup (controller_hostname); |
@@ -1815,7 +1816,6 @@ handle_init (void *cls, struct GNUNET_SERVER_Client *client, | |||
1815 | NULL, | 1816 | NULL, |
1816 | 0); | 1817 | 0); |
1817 | host_list_add (host); | 1818 | host_list_add (host); |
1818 | GNUNET_SERVER_client_keep (client); | ||
1819 | LOG_DEBUG ("Created master context with host ID: %u\n", | 1819 | LOG_DEBUG ("Created master context with host ID: %u\n", |
1820 | master_context->host_id); | 1820 | master_context->host_id); |
1821 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 1821 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
@@ -3680,6 +3680,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
3680 | struct OverlayConnectContext *occ; | 3680 | struct OverlayConnectContext *occ; |
3681 | struct RequestOverlayConnectContext *rocc; | 3681 | struct RequestOverlayConnectContext *rocc; |
3682 | struct ForwardedOperationContext *fopc; | 3682 | struct ForwardedOperationContext *fopc; |
3683 | struct MessageQueue *mq_entry; | ||
3683 | uint32_t id; | 3684 | uint32_t id; |
3684 | 3685 | ||
3685 | shutdown_task_id = GNUNET_SCHEDULER_NO_TASK; | 3686 | shutdown_task_id = GNUNET_SCHEDULER_NO_TASK; |
@@ -3795,9 +3796,19 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
3795 | GNUNET_free_non_null (master_context->master_ip); | 3796 | GNUNET_free_non_null (master_context->master_ip); |
3796 | if (NULL != master_context->system) | 3797 | if (NULL != master_context->system) |
3797 | GNUNET_TESTING_system_destroy (master_context->system, GNUNET_YES); | 3798 | GNUNET_TESTING_system_destroy (master_context->system, GNUNET_YES); |
3799 | GNUNET_SERVER_client_drop (master_context->client); | ||
3798 | GNUNET_free (master_context); | 3800 | GNUNET_free (master_context); |
3799 | master_context = NULL; | 3801 | master_context = NULL; |
3800 | } | 3802 | } |
3803 | if (NULL != transmit_handle) | ||
3804 | GNUNET_SERVER_notify_transmit_ready_cancel (transmit_handle); | ||
3805 | while (NULL != (mq_entry = mq_head)) | ||
3806 | { | ||
3807 | GNUNET_free (mq_entry->msg); | ||
3808 | GNUNET_SERVER_client_drop (mq_entry->client); | ||
3809 | GNUNET_CONTAINER_DLL_remove (mq_head, mq_tail, mq_entry); | ||
3810 | GNUNET_free (mq_entry); | ||
3811 | } | ||
3801 | GNUNET_free_non_null (hostname); | 3812 | GNUNET_free_non_null (hostname); |
3802 | GNUNET_CONFIGURATION_destroy (our_config); | 3813 | GNUNET_CONFIGURATION_destroy (our_config); |
3803 | } | 3814 | } |