diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-04-07 00:00:38 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-04-07 00:00:38 +0200 |
commit | 8ad820fae4cf114fa9e12490eba19730c8a8a850 (patch) | |
tree | 688ca8a42a70dba6b52e933e3c21d87b237219a6 /src/statistics | |
parent | 6d7fd3328a2ffe42ef52f914d913f1ee4d290adc (diff) | |
download | gnunet-8ad820fae4cf114fa9e12490eba19730c8a8a850.tar.gz gnunet-8ad820fae4cf114fa9e12490eba19730c8a8a850.zip |
fix crash
Diffstat (limited to 'src/statistics')
-rw-r--r-- | src/statistics/gnunet-statistics.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/statistics/gnunet-statistics.c b/src/statistics/gnunet-statistics.c index e004a0f1c..ae99662c4 100644 --- a/src/statistics/gnunet-statistics.c +++ b/src/statistics/gnunet-statistics.c | |||
@@ -371,7 +371,6 @@ clean_node (void *cls) | |||
371 | if (num_nodes == num_nodes_ready_shutdown) | 371 | if (num_nodes == num_nodes_ready_shutdown) |
372 | { | 372 | { |
373 | GNUNET_array_grow (nodes, num_nodes, 0); | 373 | GNUNET_array_grow (nodes, num_nodes, 0); |
374 | GNUNET_CONTAINER_multihashmap_destroy (values); | ||
375 | } | 374 | } |
376 | } | 375 | } |
377 | 376 | ||
@@ -384,7 +383,10 @@ clean_node (void *cls) | |||
384 | static void | 383 | static void |
385 | print_finish (void *cls) | 384 | print_finish (void *cls) |
386 | { | 385 | { |
387 | GNUNET_CONTAINER_multihashmap_iterate (values, printer, NULL); | 386 | GNUNET_CONTAINER_multihashmap_iterate (values, |
387 | &printer, | ||
388 | NULL); | ||
389 | GNUNET_CONTAINER_multihashmap_destroy (values); | ||
388 | GNUNET_SCHEDULER_shutdown (); | 390 | GNUNET_SCHEDULER_shutdown (); |
389 | } | 391 | } |
390 | 392 | ||
@@ -398,7 +400,8 @@ print_finish (void *cls) | |||
398 | * @param succes Whether statistics were obtained successfully. | 400 | * @param succes Whether statistics were obtained successfully. |
399 | */ | 401 | */ |
400 | static void | 402 | static void |
401 | continuation_print (void *cls, int success) | 403 | continuation_print (void *cls, |
404 | int success) | ||
402 | { | 405 | { |
403 | const unsigned index_node = *(unsigned *) cls; | 406 | const unsigned index_node = *(unsigned *) cls; |
404 | 407 | ||
@@ -406,7 +409,9 @@ continuation_print (void *cls, int success) | |||
406 | if (GNUNET_OK != success) | 409 | if (GNUNET_OK != success) |
407 | { | 410 | { |
408 | if (NULL == remote_host) | 411 | if (NULL == remote_host) |
409 | fprintf (stderr, "%s", _ ("Failed to obtain statistics.\n")); | 412 | fprintf (stderr, |
413 | "%s", | ||
414 | _ ("Failed to obtain statistics.\n")); | ||
410 | else | 415 | else |
411 | fprintf (stderr, | 416 | fprintf (stderr, |
412 | _ ("Failed to obtain statistics from host `%s:%llu'\n"), | 417 | _ ("Failed to obtain statistics from host `%s:%llu'\n"), |
@@ -419,11 +424,13 @@ continuation_print (void *cls, int success) | |||
419 | GNUNET_SCHEDULER_cancel (nodes[index_node].shutdown_task); | 424 | GNUNET_SCHEDULER_cancel (nodes[index_node].shutdown_task); |
420 | nodes[index_node].shutdown_task = NULL; | 425 | nodes[index_node].shutdown_task = NULL; |
421 | } | 426 | } |
422 | GNUNET_SCHEDULER_add_now (clean_node, &nodes[index_node].index_node); | 427 | GNUNET_SCHEDULER_add_now (&clean_node, |
428 | &nodes[index_node].index_node); | ||
423 | num_nodes_ready++; | 429 | num_nodes_ready++; |
424 | if (num_nodes_ready == num_nodes) | 430 | if (num_nodes_ready == num_nodes) |
425 | { | 431 | { |
426 | GNUNET_SCHEDULER_add_now (print_finish, NULL); | 432 | GNUNET_SCHEDULER_add_now (&print_finish, |
433 | NULL); | ||
427 | } | 434 | } |
428 | } | 435 | } |
429 | 436 | ||