From: Nathan S. Evans Date: Sun, 27 Jun 2010 14:26:17 +0000 (+0000) Subject: coverity and codesonar fixes X-Git-Tag: initial-import-from-subversion-38251~21186 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0ee59577ee81b92ee492491f4d685f26bc186c17;p=oweals%2Fgnunet.git coverity and codesonar fixes --- diff --git a/src/testing/test_testing_group_remote.c b/src/testing/test_testing_group_remote.c index 74841fb43..6b7fabb31 100644 --- a/src/testing/test_testing_group_remote.c +++ b/src/testing/test_testing_group_remote.c @@ -93,8 +93,12 @@ run (void *cls, &num_peers)) num_peers = DEFAULT_NUM_PEERS; - GNUNET_CONFIGURATION_get_value_string (cfg, "testing", "hosts", - &hostnames); + if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_string (cfg, "testing", "hosts", + &hostnames)) + { + GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "No hosts specified, running all tests on localhost\n"); + } + peers_left = num_peers; pg = GNUNET_TESTING_daemons_start (sched, diff --git a/src/testing/test_testing_topology_blacklist.c b/src/testing/test_testing_topology_blacklist.c index 22d2265c5..9788fa87c 100644 --- a/src/testing/test_testing_topology_blacklist.c +++ b/src/testing/test_testing_topology_blacklist.c @@ -377,6 +377,10 @@ run (void *cls, if (GNUNET_YES != GNUNET_CONFIGURATION_get_value_string(cfg, "paths", "servicehome", &test_directory)) { ok = 404; + if (dotOutFile != NULL) + { + fclose(dotOutFile); + } return; } @@ -407,11 +411,27 @@ run (void *cls, "connect_topology_option_modifier", "TESTING"); GNUNET_free (connect_topology_option_modifier_string); + ok = 707; + if (dotOutFile != NULL) + { + fclose(dotOutFile); + } + return; } + GNUNET_free (connect_topology_option_modifier_string); } - GNUNET_CONFIGURATION_get_value_string (cfg, "testing", "blacklist_transports", - &blacklist_transports); + if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (cfg, "testing", "blacklist_transports", + &blacklist_transports)) + { + GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "No transports specified for blacklisting in blacklist testcase (this shouldn't happen!)\n"); + ok = 808; + if (dotOutFile != NULL) + { + fclose(dotOutFile); + } + return; + } if (GNUNET_YES == GNUNET_CONFIGURATION_get_value_number (cfg, "testing", "blacklist_topology",