aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2013-06-24 12:47:41 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2013-06-24 12:47:41 +0000
commit1e007a89197769e4e0f5ad36b583689a27f33cac (patch)
tree0fd01027c4f1feb0e6f9480d3a234fc9f3f35cea
parent3d046f081a476705931e0e27fe678936b2ed2f05 (diff)
downloadgnunet-1e007a89197769e4e0f5ad36b583689a27f33cac.tar.gz
gnunet-1e007a89197769e4e0f5ad36b583689a27f33cac.zip
- coverity fixes
-rw-r--r--src/testbed/gnunet-service-testbed-logger.c3
-rw-r--r--src/testbed/gnunet-service-testbed_cache.c6
-rw-r--r--src/testbed/gnunet-service-testbed_cpustatus.c4
-rw-r--r--src/testbed/gnunet-service-testbed_peers.c6
-rw-r--r--src/testbed/testbed_api_hosts.c3
-rw-r--r--src/testbed/testbed_api_operations.c8
-rw-r--r--src/testbed/testbed_api_testbed.c1
-rw-r--r--src/testing/gnunet-testing-run-service.c4
-rw-r--r--src/testing/testing.c4
9 files changed, 25 insertions, 14 deletions
diff --git a/src/testbed/gnunet-service-testbed-logger.c b/src/testbed/gnunet-service-testbed-logger.c
index fd5c49ecc..3923ae289 100644
--- a/src/testbed/gnunet-service-testbed-logger.c
+++ b/src/testbed/gnunet-service-testbed-logger.c
@@ -201,7 +201,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
201 GNUNET_CONTAINER_DLL_remove (mq_head, mq_tail, mq_entry); 201 GNUNET_CONTAINER_DLL_remove (mq_head, mq_tail, mq_entry);
202 GNUNET_free (mq_entry); 202 GNUNET_free (mq_entry);
203 } 203 }
204 GNUNET_BIO_write_close (bio); 204 (void) GNUNET_BIO_write_close (bio);
205} 205}
206 206
207 207
@@ -241,6 +241,7 @@ logger_run (void *cls, struct GNUNET_SERVER_Handle *server,
241 { 241 {
242 LOG (GNUNET_ERROR_TYPE_ERROR, "Cannot get hostname. Exiting\n"); 242 LOG (GNUNET_ERROR_TYPE_ERROR, "Cannot get hostname. Exiting\n");
243 GNUNET_free (hname); 243 GNUNET_free (hname);
244 GNUNET_free (dir);
244 GNUNET_SCHEDULER_shutdown (); 245 GNUNET_SCHEDULER_shutdown ();
245 return; 246 return;
246 } 247 }
diff --git a/src/testbed/gnunet-service-testbed_cache.c b/src/testbed/gnunet-service-testbed_cache.c
index 1022c0959..6423f81aa 100644
--- a/src/testbed/gnunet-service-testbed_cache.c
+++ b/src/testbed/gnunet-service-testbed_cache.c
@@ -838,7 +838,7 @@ cache_clear_iterator (void *cls, const struct GNUNET_HashCode *key, void *value)
838 GNUNET_assert (NULL != entry); 838 GNUNET_assert (NULL != entry);
839 GNUNET_break (0 == entry->demand); 839 GNUNET_break (0 == entry->demand);
840 LOG_DEBUG ("Clearing entry %u of %u\n", ++ncleared, cache_size); 840 LOG_DEBUG ("Clearing entry %u of %u\n", ++ncleared, cache_size);
841 GNUNET_CONTAINER_multihashmap_remove (cache, key, value); 841 (void) GNUNET_CONTAINER_multihashmap_remove (cache, key, value);
842 close_handles (entry); 842 close_handles (entry);
843 GNUNET_free_non_null (entry->hello); 843 GNUNET_free_non_null (entry->hello);
844 GNUNET_break (GNUNET_SCHEDULER_NO_TASK == entry->expire_task); 844 GNUNET_break (GNUNET_SCHEDULER_NO_TASK == entry->expire_task);
@@ -933,9 +933,7 @@ GST_cache_get_handle_done (struct GSTCacheGetHandle *cgh)
933 } 933 }
934 else 934 else
935 { 935 {
936 struct GSTCacheGetHandle *cgh2; 936 if (NULL != search_suitable_cgh (entry, entry->cgh_qhead))
937
938 if (NULL != (cgh2 = search_suitable_cgh (entry, entry->cgh_qhead)))
939 entry->notify_task = GNUNET_SCHEDULER_add_now (&call_cgh_cb, entry); 937 entry->notify_task = GNUNET_SCHEDULER_add_now (&call_cgh_cb, entry);
940 } 938 }
941} 939}
diff --git a/src/testbed/gnunet-service-testbed_cpustatus.c b/src/testbed/gnunet-service-testbed_cpustatus.c
index 6caea9761..8145410fb 100644
--- a/src/testbed/gnunet-service-testbed_cpustatus.c
+++ b/src/testbed/gnunet-service-testbed_cpustatus.c
@@ -672,11 +672,11 @@ sample_load_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
672 if (0 < nbs) 672 if (0 < nbs)
673 { 673 {
674 GNUNET_BIO_write (bw, str, nbs); 674 GNUNET_BIO_write (bw, str, nbs);
675 GNUNET_free (str);
676 } 675 }
677 else 676 else
678 GNUNET_break (0); 677 GNUNET_break (0);
679 678 GNUNET_free (str);
679
680 reschedule: 680 reschedule:
681 sample_load_task_id = 681 sample_load_task_id =
682 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, 682 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
diff --git a/src/testbed/gnunet-service-testbed_peers.c b/src/testbed/gnunet-service-testbed_peers.c
index 34c1bf085..4fb6b2f80 100644
--- a/src/testbed/gnunet-service-testbed_peers.c
+++ b/src/testbed/gnunet-service-testbed_peers.c
@@ -1273,8 +1273,12 @@ shutdown_peers_timeout_cb (void *cls,
1273 GNUNET_assert (0 < hc->nslaves); 1273 GNUNET_assert (0 < hc->nslaves);
1274 hc->nslaves--; 1274 hc->nslaves--;
1275 if (0 == hc->nslaves) 1275 if (0 == hc->nslaves)
1276 {
1276 GST_send_operation_fail_msg (fo_ctxt->client, fo_ctxt->operation_id, 1277 GST_send_operation_fail_msg (fo_ctxt->client, fo_ctxt->operation_id,
1277 "Timeout at a slave controller"); 1278 "Timeout at a slave controller");
1279 GNUNET_free (hc);
1280 hc = NULL;
1281 }
1278 GNUNET_TESTBED_forward_operation_msg_cancel_ (fo_ctxt->opc); 1282 GNUNET_TESTBED_forward_operation_msg_cancel_ (fo_ctxt->opc);
1279 GNUNET_SERVER_client_drop (fo_ctxt->client); 1283 GNUNET_SERVER_client_drop (fo_ctxt->client);
1280 GNUNET_CONTAINER_DLL_remove (fopcq_head, fopcq_tail, fo_ctxt); 1284 GNUNET_CONTAINER_DLL_remove (fopcq_head, fopcq_tail, fo_ctxt);
@@ -1313,6 +1317,8 @@ shutdown_peers_reply_cb (void *cls,
1313 "Timeout at a slave controller"); 1317 "Timeout at a slave controller");
1314 else 1318 else
1315 GST_send_operation_success_msg (fo_ctxt->client, fo_ctxt->operation_id); 1319 GST_send_operation_success_msg (fo_ctxt->client, fo_ctxt->operation_id);
1320 GNUNET_free (hc);
1321 hc = NULL;
1316 } 1322 }
1317 GNUNET_SERVER_client_drop (fo_ctxt->client); 1323 GNUNET_SERVER_client_drop (fo_ctxt->client);
1318 GNUNET_CONTAINER_DLL_remove (fopcq_head, fopcq_tail, fo_ctxt); 1324 GNUNET_CONTAINER_DLL_remove (fopcq_head, fopcq_tail, fo_ctxt);
diff --git a/src/testbed/testbed_api_hosts.c b/src/testbed/testbed_api_hosts.c
index 2593f5ff8..bb6197e9a 100644
--- a/src/testbed/testbed_api_hosts.c
+++ b/src/testbed/testbed_api_hosts.c
@@ -1086,8 +1086,7 @@ helper_mst (void *cls, void *client, const struct GNUNET_MessageHeader *message)
1086 GNUNET_assert (GNUNET_CONFIGURATION_deserialize 1086 GNUNET_assert (GNUNET_CONFIGURATION_deserialize
1087 (cp->host->cfg, config, config_size, GNUNET_NO)); 1087 (cp->host->cfg, config, config_size, GNUNET_NO));
1088 GNUNET_free (config); 1088 GNUNET_free (config);
1089 if ((NULL == cp->host) || 1089 if (NULL == (hostname = GNUNET_TESTBED_host_get_hostname (cp->host)))
1090 (NULL == (hostname = GNUNET_TESTBED_host_get_hostname (cp->host))))
1091 hostname = "localhost"; 1090 hostname = "localhost";
1092 /* Change the hostname so that we can connect to it */ 1091 /* Change the hostname so that we can connect to it */
1093 GNUNET_CONFIGURATION_set_value_string (cp->host->cfg, "testbed", "hostname", 1092 GNUNET_CONFIGURATION_set_value_string (cp->host->cfg, "testbed", "hostname",
diff --git a/src/testbed/testbed_api_operations.c b/src/testbed/testbed_api_operations.c
index 47d135ffd..62bd59748 100644
--- a/src/testbed/testbed_api_operations.c
+++ b/src/testbed/testbed_api_operations.c
@@ -497,8 +497,12 @@ decide_capacity (struct OperationQueue *opq,
497 497
498 ret: 498 ret:
499 GNUNET_free_non_null (evict_entries); 499 GNUNET_free_non_null (evict_entries);
500 if (NULL != ops_) *ops_ = ops; 500 if (NULL != ops_)
501 if (NULL != n_ops_) *n_ops_ = n_ops; 501 *ops_ = ops;
502 else
503 GNUNET_free (ops);
504 if (NULL != n_ops_)
505 *n_ops_ = n_ops;
502 return rval; 506 return rval;
503} 507}
504 508
diff --git a/src/testbed/testbed_api_testbed.c b/src/testbed/testbed_api_testbed.c
index 8e3a1073e..4d5768af6 100644
--- a/src/testbed/testbed_api_testbed.c
+++ b/src/testbed/testbed_api_testbed.c
@@ -1301,6 +1301,7 @@ GNUNET_TESTBED_run (const char *host_filename,
1301 "OVERLAY_TOPOLOGY_FILE"); 1301 "OVERLAY_TOPOLOGY_FILE");
1302 goto error_cleanup; 1302 goto error_cleanup;
1303 } 1303 }
1304 break;
1304 default: 1305 default:
1305 /* Warn if OVERLAY_RANDOM_LINKS is present that it will be ignored */ 1306 /* Warn if OVERLAY_RANDOM_LINKS is present that it will be ignored */
1306 if (GNUNET_YES == 1307 if (GNUNET_YES ==
diff --git a/src/testing/gnunet-testing-run-service.c b/src/testing/gnunet-testing-run-service.c
index ed60a409b..b967d7385 100644
--- a/src/testing/gnunet-testing-run-service.c
+++ b/src/testing/gnunet-testing-run-service.c
@@ -116,8 +116,8 @@ stdin_cb (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
116 GNUNET_SCHEDULER_shutdown (); 116 GNUNET_SCHEDULER_shutdown ();
117 return; 117 return;
118 case 'r': 118 case 'r':
119 GNUNET_TESTING_peer_stop (my_peer); 119 (void) GNUNET_TESTING_peer_stop (my_peer);
120 GNUNET_TESTING_peer_start (my_peer); 120 (void) GNUNET_TESTING_peer_start (my_peer);
121 printf ("restarted\n"); 121 printf ("restarted\n");
122 fflush (stdout); 122 fflush (stdout);
123 break; 123 break;
diff --git a/src/testing/testing.c b/src/testing/testing.c
index d73d5ece3..898af1674 100644
--- a/src/testing/testing.c
+++ b/src/testing/testing.c
@@ -512,7 +512,9 @@ static void
512stop_shared_service_instance (struct SharedServiceInstance *i) 512stop_shared_service_instance (struct SharedServiceInstance *i)
513{ 513{
514 GNUNET_break (0 == i->n_refs); 514 GNUNET_break (0 == i->n_refs);
515 GNUNET_OS_process_kill (i->proc, SIGTERM); 515 if (0 != GNUNET_OS_process_kill (i->proc, SIGTERM))
516 LOG (GNUNET_ERROR_TYPE_WARNING,
517 "Killing shared service instance (%s) failed\n", i->ss->sname);
516 (void) GNUNET_OS_process_wait (i->proc); 518 (void) GNUNET_OS_process_wait (i->proc);
517 GNUNET_OS_process_destroy (i->proc); 519 GNUNET_OS_process_destroy (i->proc);
518 i->proc = NULL; 520 i->proc = NULL;