diff options
author | Bart Polot <bart@net.in.tum.de> | 2012-02-14 10:35:31 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2012-02-14 10:35:31 +0000 |
commit | d9885b2861ad27b33cd31534f77b0197cd00e894 (patch) | |
tree | 655a6717c1b773f5db9b362c6de92f863396a6f6 | |
parent | cee04ec80653f8fecf198d8fe14dc73f84b53524 (diff) | |
download | gnunet-d9885b2861ad27b33cd31534f77b0197cd00e894.tar.gz gnunet-d9885b2861ad27b33cd31534f77b0197cd00e894.zip |
- fix for access of freed meter after ctrl-c
-rw-r--r-- | src/testing/testing_peergroup.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/testing/testing_peergroup.c b/src/testing/testing_peergroup.c index a34cb5abe..0421b000a 100644 --- a/src/testing/testing_peergroup.c +++ b/src/testing/testing_peergroup.c | |||
@@ -463,6 +463,16 @@ internal_topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, | |||
463 | } | 463 | } |
464 | } | 464 | } |
465 | 465 | ||
466 | |||
467 | /** | ||
468 | * Callback called for each started daemon. | ||
469 | * | ||
470 | * @param cls Clause (PG Context). | ||
471 | * @param id PeerIdentidy of started daemon. | ||
472 | * @param cfg Configuration used by the daemon. | ||
473 | * @param d Handle for the daemon. | ||
474 | * @param emsg Error message, NULL on success. | ||
475 | */ | ||
466 | static void | 476 | static void |
467 | internal_peers_started_callback (void *cls, | 477 | internal_peers_started_callback (void *cls, |
468 | const struct GNUNET_PeerIdentity *id, | 478 | const struct GNUNET_PeerIdentity *id, |
@@ -488,6 +498,11 @@ internal_peers_started_callback (void *cls, | |||
488 | 498 | ||
489 | pg_start_ctx->peers_left--; | 499 | pg_start_ctx->peers_left--; |
490 | 500 | ||
501 | if (NULL == pg_start_ctx->peer_start_meter) | ||
502 | { | ||
503 | /* Cancelled Ctrl-C or error */ | ||
504 | return; | ||
505 | } | ||
491 | if (GNUNET_YES == update_meter (pg_start_ctx->peer_start_meter)) | 506 | if (GNUNET_YES == update_meter (pg_start_ctx->peer_start_meter)) |
492 | { | 507 | { |
493 | #if VERBOSE | 508 | #if VERBOSE |