aboutsummaryrefslogtreecommitdiff
path: root/src/testbed/testbed_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testbed/testbed_api.c')
-rw-r--r--src/testbed/testbed_api.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/testbed/testbed_api.c b/src/testbed/testbed_api.c
index 175c08404..6fce5adde 100644
--- a/src/testbed/testbed_api.c
+++ b/src/testbed/testbed_api.c
@@ -410,6 +410,7 @@ handle_peer_config (struct GNUNET_TESTBED_Controller *c,
410{ 410{
411 struct GNUNET_TESTBED_Operation *op; 411 struct GNUNET_TESTBED_Operation *op;
412 struct GNUNET_TESTBED_Peer *peer; 412 struct GNUNET_TESTBED_Peer *peer;
413 struct PeerInfoData *data;
413 struct GNUNET_TESTBED_EventInformation info; 414 struct GNUNET_TESTBED_EventInformation info;
414 uint64_t op_id; 415 uint64_t op_id;
415 416
@@ -424,12 +425,15 @@ handle_peer_config (struct GNUNET_TESTBED_Controller *c,
424 LOG_DEBUG ("Operation not found"); 425 LOG_DEBUG ("Operation not found");
425 return GNUNET_YES; 426 return GNUNET_YES;
426 } 427 }
427 peer = op->data; 428 data = op->data;
429 GNUNET_assert (NULL != data);
430 peer = data->peer;
428 GNUNET_assert (NULL != peer); 431 GNUNET_assert (NULL != peer);
429 GNUNET_assert (ntohl (msg->peer_id) == peer->unique_id); 432 GNUNET_assert (ntohl (msg->peer_id) == peer->unique_id);
430 if (0 == (c->event_mask & (1L << GNUNET_TESTBED_ET_OPERATION_FINISHED))) 433 if (0 == (c->event_mask & (1L << GNUNET_TESTBED_ET_OPERATION_FINISHED)))
431 { 434 {
432 GNUNET_CONTAINER_DLL_remove (c->op_head, c->op_tail, op); 435 GNUNET_CONTAINER_DLL_remove (c->op_head, c->op_tail, op);
436 GNUNET_free (data);
433 GNUNET_free (op); 437 GNUNET_free (op);
434 return GNUNET_YES; 438 return GNUNET_YES;
435 } 439 }
@@ -437,8 +441,8 @@ handle_peer_config (struct GNUNET_TESTBED_Controller *c,
437 info.details.operation_finished.operation = op; 441 info.details.operation_finished.operation = op;
438 info.details.operation_finished.op_cls = NULL; 442 info.details.operation_finished.op_cls = NULL;
439 info.details.operation_finished.emsg = NULL; 443 info.details.operation_finished.emsg = NULL;
440 info.details.operation_finished.pit = op->operation_id; 444 info.details.operation_finished.pit = data->pit;
441 switch (op->operation_id) 445 switch (data->pit)
442 { 446 {
443 case GNUNET_TESTBED_PIT_IDENTITY: 447 case GNUNET_TESTBED_PIT_IDENTITY:
444 { 448 {
@@ -467,7 +471,9 @@ handle_peer_config (struct GNUNET_TESTBED_Controller *c,
467 cfg = GNUNET_CONFIGURATION_create (); 471 cfg = GNUNET_CONFIGURATION_create ();
468 GNUNET_assert (GNUNET_OK == 472 GNUNET_assert (GNUNET_OK ==
469 GNUNET_CONFIGURATION_deserialize (cfg, config, 473 GNUNET_CONFIGURATION_deserialize (cfg, config,
470 (size_t) config_size, GNUNET_NO)); 474 (size_t) config_size,
475 GNUNET_NO));
476 GNUNET_free (config);
471 info.details.operation_finished.op_result.cfg = cfg; 477 info.details.operation_finished.op_result.cfg = cfg;
472 } 478 }
473 break; 479 break;
@@ -477,6 +483,7 @@ handle_peer_config (struct GNUNET_TESTBED_Controller *c,
477 } 483 }
478 c->cc (c->cc_cls, &info); 484 c->cc (c->cc_cls, &info);
479 GNUNET_CONTAINER_DLL_remove (c->op_head, c->op_tail, op); 485 GNUNET_CONTAINER_DLL_remove (c->op_head, c->op_tail, op);
486 GNUNET_free (data);
480 GNUNET_free (op); 487 GNUNET_free (op);
481 return GNUNET_YES; 488 return GNUNET_YES;
482} 489}