summaryrefslogtreecommitdiff
path: root/src/testbed/test_testbed_api_statistics.c
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2013-09-05 11:40:07 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2013-09-05 11:40:07 +0000
commitacb2568116de77fcac08ab1ac8b4df81a886f4be (patch)
tree78b7bd0a722045add429d1595ade521b817a95c7 /src/testbed/test_testbed_api_statistics.c
parent8f8ed9394c1889f6b302511ac400fa4d55fb1e78 (diff)
downloadgnunet-acb2568116de77fcac08ab1ac8b4df81a886f4be.tar.gz
gnunet-acb2568116de77fcac08ab1ac8b4df81a886f4be.zip
- fix memleaks
Diffstat (limited to 'src/testbed/test_testbed_api_statistics.c')
-rw-r--r--src/testbed/test_testbed_api_statistics.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/testbed/test_testbed_api_statistics.c b/src/testbed/test_testbed_api_statistics.c
index bc01f6bc8..463dc736e 100644
--- a/src/testbed/test_testbed_api_statistics.c
+++ b/src/testbed/test_testbed_api_statistics.c
@@ -59,6 +59,17 @@ static GNUNET_SCHEDULER_TaskIdentifier abort_task;
59static int result; 59static int result;
60 60
61/** 61/**
62 * The peers we have seen in the statistics iterator
63 */
64static struct GNUNET_TESTBED_Peer **seen_peers;
65
66/**
67 * Number of peers in the above array
68 */
69static unsigned int num_seen_peers;
70
71
72/**
62 * Fail testcase 73 * Fail testcase
63 */ 74 */
64#define FAIL_TEST(cond, ret) do { \ 75#define FAIL_TEST(cond, ret) do { \
@@ -109,8 +120,6 @@ stats_iterator (void *cls,
109 const char *subsystem, const char *name, uint64_t value, 120 const char *subsystem, const char *name, uint64_t value,
110 int is_persistent) 121 int is_persistent)
111{ 122{
112 static struct GNUNET_TESTBED_Peer **seen_peers;
113 static unsigned int num_seen_peers;
114 unsigned int cnt; 123 unsigned int cnt;
115 124
116 FAIL_TEST (cls == dummy_cls, return GNUNET_SYSERR); 125 FAIL_TEST (cls == dummy_cls, return GNUNET_SYSERR);
@@ -187,6 +196,7 @@ main (int argc, char **argv)
187 NUM_PEERS, 196 NUM_PEERS,
188 1LL, NULL, NULL, 197 1LL, NULL, NULL,
189 &test_master, NULL); 198 &test_master, NULL);
199 GNUNET_free_non_null (seen_peers);
190 if (GNUNET_OK != result) 200 if (GNUNET_OK != result)
191 return 1; 201 return 1;
192 return 0; 202 return 0;