coverity fixes
authorNathan S. Evans <evans@in.tum.de>
Fri, 12 Nov 2010 10:49:20 +0000 (10:49 +0000)
committerNathan S. Evans <evans@in.tum.de>
Fri, 12 Nov 2010 10:49:20 +0000 (10:49 +0000)
src/dht/gnunet-dht-driver.c
src/dht/gnunet-service-dht.c
src/dht/plugin_dhtlog_mysql_dump_load.c

index b59b148135c16765cf2f6b6419fc6132b1c3cc2a..fdd442cdbd6b93a413021dd15f11e1ad7b09200b 100644 (file)
@@ -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 */
index 60df8356e677770fd5468f02b37ed62311fd285b..933a208fe33dc08c15e0f25b168b8de168fffdaf 100644 (file)
@@ -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);
 }
 
index 973b20908fd9aefa90e341f25edab23a2c21c25f..45e0e1afbd0d33d1ed4e2152191bdb3d3b61d7da 100644 (file)
@@ -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)