From: Nathan S. Evans Date: Fri, 12 Nov 2010 10:49:20 +0000 (+0000) Subject: coverity fixes X-Git-Tag: initial-import-from-subversion-38251~19757 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=15ac26c9d907f388097093b665bada80b3bb9581;p=oweals%2Fgnunet.git coverity fixes --- diff --git a/src/dht/gnunet-dht-driver.c b/src/dht/gnunet-dht-driver.c index b59b14813..fdd442cdb 100644 --- a/src/dht/gnunet-dht-driver.c +++ b/src/dht/gnunet-dht-driver.c @@ -2050,7 +2050,7 @@ schedule_find_peer_requests (void *cls, const struct GNUNET_SCHEDULER_TaskContex else /* If we have sent requests, choose peers with a low number of connections to send requests from */ { peer_count = GNUNET_CONTAINER_heap_remove_root(find_peer_ctx->peer_min_heap); - GNUNET_CONTAINER_multihashmap_remove(find_peer_ctx->peer_hash, &peer_count->peer_id.hashPubKey, peer_count); + GNUNET_assert(GNUNET_YES == GNUNET_CONTAINER_multihashmap_remove(find_peer_ctx->peer_hash, &peer_count->peer_id.hashPubKey, peer_count)); test_find_peer->daemon = GNUNET_TESTING_daemon_get_by_id(pg, &peer_count->peer_id); GNUNET_assert(test_find_peer->daemon != NULL); } @@ -3040,7 +3040,7 @@ run (void *cls, &num_peers)) { GNUNET_log (GNUNET_ERROR_TYPE_WARNING, - "Number of peers must be specified in section %s option %s\n", topology_str, "TESTING", "NUM_PEERS"); + "Number of peers must be specified in section %s option %s\n", "TESTING", "NUM_PEERS"); } GNUNET_assert(num_peers > 0 && num_peers < ULONG_MAX); /* Set peers_left so we know when all peers started */ diff --git a/src/dht/gnunet-service-dht.c b/src/dht/gnunet-service-dht.c index 60df8356e..933a208fe 100644 --- a/src/dht/gnunet-service-dht.c +++ b/src/dht/gnunet-service-dht.c @@ -1535,7 +1535,7 @@ static void delete_peer (struct PeerInfo *peer, } GNUNET_assert(GNUNET_CONTAINER_multihashmap_contains(all_known_peers, &peer->id.hashPubKey)); - GNUNET_CONTAINER_multihashmap_remove (all_known_peers, &peer->id.hashPubKey, peer); + GNUNET_assert(GNUNET_YES == GNUNET_CONTAINER_multihashmap_remove (all_known_peers, &peer->id.hashPubKey, peer)); GNUNET_free(peer); } diff --git a/src/dht/plugin_dhtlog_mysql_dump_load.c b/src/dht/plugin_dhtlog_mysql_dump_load.c index 973b20908..45e0e1afb 100644 --- a/src/dht/plugin_dhtlog_mysql_dump_load.c +++ b/src/dht/plugin_dhtlog_mysql_dump_load.c @@ -586,7 +586,7 @@ libgnunet_plugin_dhtlog_mysql_dump_load_init (void * cls) outfile_path, "mysqldump_nodes", getpid()); - + GNUNET_free(fn); fn = GNUNET_STRINGS_filename_expand (outfile_name); if (fn == NULL) @@ -619,6 +619,7 @@ libgnunet_plugin_dhtlog_mysql_dump_load_init (void * cls) "mysqldump_routes", getpid()); + GNUNET_free(fn); fn = GNUNET_STRINGS_filename_expand (outfile_name); if (fn == NULL) @@ -651,6 +652,7 @@ libgnunet_plugin_dhtlog_mysql_dump_load_init (void * cls) "mysqldump_queries", getpid()); + GNUNET_free(fn); fn = GNUNET_STRINGS_filename_expand (outfile_name); if (fn == NULL) @@ -683,6 +685,7 @@ libgnunet_plugin_dhtlog_mysql_dump_load_init (void * cls) "mysqldump_stats", getpid()); + GNUNET_free(fn); fn = GNUNET_STRINGS_filename_expand (outfile_name); if (fn == NULL) @@ -714,7 +717,7 @@ libgnunet_plugin_dhtlog_mysql_dump_load_init (void * cls) outfile_path, "mysqldump_generic_stats", getpid()); - + GNUNET_free(fn); fn = GNUNET_STRINGS_filename_expand (outfile_name); if (fn == NULL) @@ -746,7 +749,7 @@ libgnunet_plugin_dhtlog_mysql_dump_load_init (void * cls) outfile_path, "mysqldump_dhtkey", getpid()); - + GNUNET_free(fn); fn = GNUNET_STRINGS_filename_expand (outfile_name); if (fn == NULL) @@ -778,7 +781,7 @@ libgnunet_plugin_dhtlog_mysql_dump_load_init (void * cls) outfile_path, "mysqldump_extended_topology", getpid()); - + GNUNET_free(fn); fn = GNUNET_STRINGS_filename_expand (outfile_name); if (fn == NULL)