aboutsummaryrefslogtreecommitdiff
path: root/src/ats-tests/ats-testing-experiment.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2014-12-19 14:01:18 +0000
committerChristian Grothoff <christian@grothoff.org>2014-12-19 14:01:18 +0000
commit9b3124e045a61865805b7a97f87700609cb926cb (patch)
treef46fae02dcdb3e007d9b1618ab1052420464a78a /src/ats-tests/ats-testing-experiment.c
parentdc0da39a4d4a086b5286ae4705a3b96695d2f5f0 (diff)
downloadgnunet-9b3124e045a61865805b7a97f87700609cb926cb.tar.gz
gnunet-9b3124e045a61865805b7a97f87700609cb926cb.zip
-fix sec_name leak
Diffstat (limited to 'src/ats-tests/ats-testing-experiment.c')
-rw-r--r--src/ats-tests/ats-testing-experiment.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/ats-tests/ats-testing-experiment.c b/src/ats-tests/ats-testing-experiment.c
index a6feee07c..b07d8fdcd 100644
--- a/src/ats-tests/ats-testing-experiment.c
+++ b/src/ats-tests/ats-testing-experiment.c
@@ -86,9 +86,11 @@ free_experiment (struct Experiment *e)
86 GNUNET_free (e); 86 GNUNET_free (e);
87} 87}
88 88
89
89static int 90static int
90load_episode (struct Experiment *e, struct Episode *cur, 91load_episode (struct Experiment *e,
91 struct GNUNET_CONFIGURATION_Handle *cfg) 92 struct Episode *cur,
93 struct GNUNET_CONFIGURATION_Handle *cfg)
92{ 94{
93 struct GNUNET_ATS_TEST_Operation *o; 95 struct GNUNET_ATS_TEST_Operation *o;
94 char *sec_name; 96 char *sec_name;
@@ -99,12 +101,12 @@ load_episode (struct Experiment *e, struct Episode *cur,
99 int op_counter = 0; 101 int op_counter = 0;
100 102
101 fprintf (stderr, "Parsing episode %u\n",cur->id); 103 fprintf (stderr, "Parsing episode %u\n",cur->id);
102 GNUNET_asprintf(&sec_name, "episode-%u", cur->id); 104 GNUNET_asprintf (&sec_name, "episode-%u", cur->id);
103 105
104 while (1) 106 while (1)
105 { 107 {
106 /* Load operation */ 108 /* Load operation */
107 GNUNET_asprintf(&op_name, "op-%u-operation", op_counter); 109 GNUNET_asprintf (&op_name, "op-%u-operation", op_counter);
108 if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_string(cfg, 110 if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_string(cfg,
109 sec_name, op_name, &op)) 111 sec_name, op_name, &op))
110 { 112 {
@@ -136,6 +138,7 @@ load_episode (struct Experiment *e, struct Episode *cur,
136 GNUNET_free (op); 138 GNUNET_free (op);
137 GNUNET_free (op_name); 139 GNUNET_free (op_name);
138 GNUNET_free (o); 140 GNUNET_free (o);
141 GNUNET_free (sec_name);
139 return GNUNET_SYSERR; 142 return GNUNET_SYSERR;
140 } 143 }
141 GNUNET_free (op_name); 144 GNUNET_free (op_name);
@@ -150,6 +153,7 @@ load_episode (struct Experiment *e, struct Episode *cur,
150 GNUNET_free (op); 153 GNUNET_free (op);
151 GNUNET_free (op_name); 154 GNUNET_free (op_name);
152 GNUNET_free (o); 155 GNUNET_free (o);
156 GNUNET_free (sec_name);
153 return GNUNET_SYSERR; 157 return GNUNET_SYSERR;
154 } 158 }
155 if (o->src_id > (e->num_masters - 1)) 159 if (o->src_id > (e->num_masters - 1))
@@ -159,6 +163,7 @@ load_episode (struct Experiment *e, struct Episode *cur,
159 GNUNET_free (op); 163 GNUNET_free (op);
160 GNUNET_free (op_name); 164 GNUNET_free (op_name);
161 GNUNET_free (o); 165 GNUNET_free (o);
166 GNUNET_free (sec_name);
162 return GNUNET_SYSERR; 167 return GNUNET_SYSERR;
163 } 168 }
164 GNUNET_free (op_name); 169 GNUNET_free (op_name);
@@ -173,6 +178,7 @@ load_episode (struct Experiment *e, struct Episode *cur,
173 GNUNET_free (op); 178 GNUNET_free (op);
174 GNUNET_free (op_name); 179 GNUNET_free (op_name);
175 GNUNET_free (o); 180 GNUNET_free (o);
181 GNUNET_free (sec_name);
176 return GNUNET_SYSERR; 182 return GNUNET_SYSERR;
177 } 183 }
178 if (o->dest_id > (e->num_slaves - 1)) 184 if (o->dest_id > (e->num_slaves - 1))
@@ -182,6 +188,7 @@ load_episode (struct Experiment *e, struct Episode *cur,
182 GNUNET_free (op); 188 GNUNET_free (op);
183 GNUNET_free (op_name); 189 GNUNET_free (op_name);
184 GNUNET_free (o); 190 GNUNET_free (o);
191 GNUNET_free (sec_name);
185 return GNUNET_SYSERR; 192 return GNUNET_SYSERR;
186 } 193 }
187 GNUNET_free (op_name); 194 GNUNET_free (op_name);
@@ -252,6 +259,7 @@ load_episode (struct Experiment *e, struct Episode *cur,
252 GNUNET_free (op_name); 259 GNUNET_free (op_name);
253 GNUNET_free (op); 260 GNUNET_free (op);
254 GNUNET_free (o); 261 GNUNET_free (o);
262 GNUNET_free (sec_name);
255 return GNUNET_SYSERR; 263 return GNUNET_SYSERR;
256 } 264 }
257 } 265 }
@@ -279,6 +287,7 @@ load_episode (struct Experiment *e, struct Episode *cur,
279 GNUNET_free (op_name); 287 GNUNET_free (op_name);
280 GNUNET_free (op); 288 GNUNET_free (op);
281 GNUNET_free (o); 289 GNUNET_free (o);
290 GNUNET_free (sec_name);
282 return GNUNET_SYSERR; 291 return GNUNET_SYSERR;
283 } 292 }
284 GNUNET_free (op_name); 293 GNUNET_free (op_name);
@@ -295,6 +304,7 @@ load_episode (struct Experiment *e, struct Episode *cur,
295 GNUNET_free (op); 304 GNUNET_free (op);
296 GNUNET_free_non_null (pref); 305 GNUNET_free_non_null (pref);
297 GNUNET_free (o); 306 GNUNET_free (o);
307 GNUNET_free (sec_name);
298 return GNUNET_SYSERR; 308 return GNUNET_SYSERR;
299 } 309 }
300 310
@@ -312,6 +322,7 @@ load_episode (struct Experiment *e, struct Episode *cur,
312 GNUNET_free (pref); 322 GNUNET_free (pref);
313 GNUNET_free_non_null (pref); 323 GNUNET_free_non_null (pref);
314 GNUNET_free (o); 324 GNUNET_free (o);
325 GNUNET_free (sec_name);
315 return GNUNET_SYSERR; 326 return GNUNET_SYSERR;
316 } 327 }
317 GNUNET_free (pref); 328 GNUNET_free (pref);
@@ -352,6 +363,7 @@ load_episode (struct Experiment *e, struct Episode *cur,
352 return GNUNET_OK; 363 return GNUNET_OK;
353} 364}
354 365
366
355static int 367static int
356load_episodes (struct Experiment *e, struct GNUNET_CONFIGURATION_Handle *cfg) 368load_episodes (struct Experiment *e, struct GNUNET_CONFIGURATION_Handle *cfg)
357{ 369{