From d9885b2861ad27b33cd31534f77b0197cd00e894 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Tue, 14 Feb 2012 10:35:31 +0000 Subject: - fix for access of freed meter after ctrl-c --- src/testing/testing_peergroup.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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, } } + +/** + * Callback called for each started daemon. + * + * @param cls Clause (PG Context). + * @param id PeerIdentidy of started daemon. + * @param cfg Configuration used by the daemon. + * @param d Handle for the daemon. + * @param emsg Error message, NULL on success. + */ static void internal_peers_started_callback (void *cls, const struct GNUNET_PeerIdentity *id, @@ -488,6 +498,11 @@ internal_peers_started_callback (void *cls, pg_start_ctx->peers_left--; + if (NULL == pg_start_ctx->peer_start_meter) + { + /* Cancelled Ctrl-C or error */ + return; + } if (GNUNET_YES == update_meter (pg_start_ctx->peer_start_meter)) { #if VERBOSE -- cgit v1.2.3