diff options
author | Julius Bünger <buenger@mytum.de> | 2016-05-13 22:49:23 +0000 |
---|---|---|
committer | Julius Bünger <buenger@mytum.de> | 2016-05-13 22:49:23 +0000 |
commit | 2e9c33a97aaf0431f6c79ba87597e052b7c95e1b (patch) | |
tree | b0a828416427fb2ed5fc63e5fef84de3acab3610 | |
parent | a4dc4b16eaa5101aba46168ad7d809a1f3086c0c (diff) | |
download | gnunet-2e9c33a97aaf0431f6c79ba87597e052b7c95e1b.tar.gz gnunet-2e9c33a97aaf0431f6c79ba87597e052b7c95e1b.zip |
-rps: try to avoid leaking memory
-rw-r--r-- | src/rps/gnunet-service-rps.c | 5 | ||||
-rw-r--r-- | src/rps/gnunet-service-rps_sampler.c | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c index 822c5e655..c7cdccdfb 100644 --- a/src/rps/gnunet-service-rps.c +++ b/src/rps/gnunet-service-rps.c | |||
@@ -892,6 +892,10 @@ static void | |||
892 | destroy_cli_ctx (struct ClientContext *cli_ctx) | 892 | destroy_cli_ctx (struct ClientContext *cli_ctx) |
893 | { | 893 | { |
894 | GNUNET_assert (NULL != cli_ctx); | 894 | GNUNET_assert (NULL != cli_ctx); |
895 | if (NULL != cli_ctx->mq) | ||
896 | { | ||
897 | GNUNET_MQ_destroy (cli_ctx->mq); | ||
898 | } | ||
895 | if (NULL != cli_ctx->rep_cls_head) | 899 | if (NULL != cli_ctx->rep_cls_head) |
896 | { | 900 | { |
897 | LOG (GNUNET_ERROR_TYPE_WARNING, | 901 | LOG (GNUNET_ERROR_TYPE_WARNING, |
@@ -2070,6 +2074,7 @@ shutdown_task (void *cls) | |||
2070 | CustomPeerMap_destroy (pull_map); | 2074 | CustomPeerMap_destroy (pull_map); |
2071 | #ifdef ENABLE_MALICIOUS | 2075 | #ifdef ENABLE_MALICIOUS |
2072 | struct AttackedPeer *tmp_att_peer; | 2076 | struct AttackedPeer *tmp_att_peer; |
2077 | GNUNET_free (file_name_view_log); | ||
2073 | GNUNET_array_grow (mal_peers, num_mal_peers, 0); | 2078 | GNUNET_array_grow (mal_peers, num_mal_peers, 0); |
2074 | if (NULL != mal_peer_set) | 2079 | if (NULL != mal_peer_set) |
2075 | GNUNET_CONTAINER_multipeermap_destroy (mal_peer_set); | 2080 | GNUNET_CONTAINER_multipeermap_destroy (mal_peer_set); |
diff --git a/src/rps/gnunet-service-rps_sampler.c b/src/rps/gnunet-service-rps_sampler.c index 2ac6054f4..a3e33e5c8 100644 --- a/src/rps/gnunet-service-rps_sampler.c +++ b/src/rps/gnunet-service-rps_sampler.c | |||
@@ -327,6 +327,7 @@ sampler_resize (struct RPS_Sampler *sampler, unsigned int new_size) | |||
327 | "-%" PRIu32 ": %s", | 327 | "-%" PRIu32 ": %s", |
328 | i, | 328 | i, |
329 | sampler->sampler_elements[i]->file_name); | 329 | sampler->sampler_elements[i]->file_name); |
330 | GNUNET_free (sampler->sampler_elements[i]); | ||
330 | } | 331 | } |
331 | 332 | ||
332 | GNUNET_array_grow (sampler->sampler_elements, | 333 | GNUNET_array_grow (sampler->sampler_elements, |