summaryrefslogtreecommitdiff
path: root/src/rps
diff options
context:
space:
mode:
authorJulius Bünger <buenger@mytum.de>2019-04-11 16:00:51 +0200
committerJulius Bünger <buenger@mytum.de>2019-04-11 16:00:51 +0200
commitd4442d0f774b61709f3cfc3c51421096e3e3eb53 (patch)
tree39e4e548b5b438b53a262953e4ccc3edfd07d215 /src/rps
parent6fd0634f2e378276c93e84b3d296f43307aae317 (diff)
downloadgnunet-d4442d0f774b61709f3cfc3c51421096e3e3eb53.tar.gz
gnunet-d4442d0f774b61709f3cfc3c51421096e3e3eb53.zip
RPS profiler: Fix computation of history probabilities
Diffstat (limited to 'src/rps')
-rw-r--r--src/rps/gnunet-rps-profiler.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/rps/gnunet-rps-profiler.c b/src/rps/gnunet-rps-profiler.c
index 1ab81c3fb..0138346e4 100644
--- a/src/rps/gnunet-rps-profiler.c
+++ b/src/rps/gnunet-rps-profiler.c
@@ -1192,6 +1192,7 @@ post_test_op (void *cls)
1192 shutdown_task = NULL; 1192 shutdown_task = NULL;
1193 GNUNET_SCHEDULER_shutdown (); 1193 GNUNET_SCHEDULER_shutdown ();
1194 } 1194 }
1195 GNUNET_free (cur_test_run.eval_probs_cache);
1195} 1196}
1196 1197
1197 1198
@@ -2365,6 +2366,7 @@ static void compute_probabilities (uint32_t peer_idx)
2365 probs_as_str_size, 2366 probs_as_str_size,
2366 probs_as_str); 2367 probs_as_str);
2367 2368
2369 probs_as_str[0] = '\0';
2368 for (i = 0; i < num_peers; i++) 2370 for (i = 0; i < num_peers; i++)
2369 { 2371 {
2370 probs_as_str_cpy = GNUNET_strndup (probs_as_str, probs_as_str_size); 2372 probs_as_str_cpy = GNUNET_strndup (probs_as_str, probs_as_str_size);
@@ -2810,7 +2812,6 @@ post_profiler (struct RPSPeer *rps_peer)
2810 rps_peer->index); 2812 rps_peer->index);
2811 } 2813 }
2812 } 2814 }
2813 GNUNET_free (cur_test_run.eval_probs_cache);
2814} 2815}
2815 2816
2816 2817
@@ -3000,7 +3001,7 @@ run (void *cls,
3000 BIT(STAT_TYPE_VIEW_SIZE_AIM); 3001 BIT(STAT_TYPE_VIEW_SIZE_AIM);
3001 cur_test_run.have_collect_view = COLLECT_VIEW; 3002 cur_test_run.have_collect_view = COLLECT_VIEW;
3002 cur_test_run.eval_probs_cache = GNUNET_new_array (num_peers, double); 3003 cur_test_run.eval_probs_cache = GNUNET_new_array (num_peers, double);
3003 memset (cur_test_run.eval_probs_cache, num_peers * sizeof (double), 0); 3004 memset (&cur_test_run.eval_probs_cache, num_peers * sizeof (double), 0);
3004 3005
3005 /* 'Clean' directory */ 3006 /* 'Clean' directory */
3006 (void) GNUNET_DISK_directory_remove ("/tmp/rps/"); 3007 (void) GNUNET_DISK_directory_remove ("/tmp/rps/");