diff options
author | LRN <lrn1986@gmail.com> | 2013-12-19 06:00:23 +0000 |
---|---|---|
committer | LRN <lrn1986@gmail.com> | 2013-12-19 06:00:23 +0000 |
commit | e0ca7357cd0bfedc5c29cb731b56279fef8da059 (patch) | |
tree | ecfd47cf59bc00e656b53fd59c58f5038e342d65 /src/testbed | |
parent | 92fd84dc7ef98452f848a62677c61a2b80b5835e (diff) | |
download | gnunet-e0ca7357cd0bfedc5c29cb731b56279fef8da059.tar.gz gnunet-e0ca7357cd0bfedc5c29cb731b56279fef8da059.zip |
malloc -> new
Diffstat (limited to 'src/testbed')
-rw-r--r-- | src/testbed/gnunet-helper-testbed.c | 2 | ||||
-rw-r--r-- | src/testbed/gnunet-service-testbed-logger.c | 2 | ||||
-rw-r--r-- | src/testbed/gnunet-service-testbed.c | 6 | ||||
-rw-r--r-- | src/testbed/gnunet-service-testbed_barriers.c | 8 | ||||
-rw-r--r-- | src/testbed/gnunet-service-testbed_cache.c | 2 | ||||
-rw-r--r-- | src/testbed/gnunet-service-testbed_links.c | 18 | ||||
-rw-r--r-- | src/testbed/gnunet-service-testbed_oc.c | 14 | ||||
-rw-r--r-- | src/testbed/testbed_api.c | 28 | ||||
-rw-r--r-- | src/testbed/testbed_api_barriers.c | 4 | ||||
-rw-r--r-- | src/testbed/testbed_api_hosts.c | 10 | ||||
-rw-r--r-- | src/testbed/testbed_api_operations.c | 10 | ||||
-rw-r--r-- | src/testbed/testbed_api_peers.c | 40 | ||||
-rw-r--r-- | src/testbed/testbed_api_sd.c | 4 | ||||
-rw-r--r-- | src/testbed/testbed_api_services.c | 2 | ||||
-rw-r--r-- | src/testbed/testbed_api_statistics.c | 4 | ||||
-rw-r--r-- | src/testbed/testbed_api_testbed.c | 10 | ||||
-rw-r--r-- | src/testbed/testbed_api_topology.c | 4 | ||||
-rw-r--r-- | src/testbed/testbed_logger_api.c | 4 |
18 files changed, 86 insertions, 86 deletions
diff --git a/src/testbed/gnunet-helper-testbed.c b/src/testbed/gnunet-helper-testbed.c index 4c68b2cd4..e8c70a354 100644 --- a/src/testbed/gnunet-helper-testbed.c +++ b/src/testbed/gnunet-helper-testbed.c | |||
@@ -480,7 +480,7 @@ tokenizer_cb (void *cls, void *client, | |||
480 | xconfig_size = | 480 | xconfig_size = |
481 | GNUNET_TESTBED_compress_config_ (config, config_size, &xconfig); | 481 | GNUNET_TESTBED_compress_config_ (config, config_size, &xconfig); |
482 | GNUNET_free (config); | 482 | GNUNET_free (config); |
483 | wc = GNUNET_malloc (sizeof (struct WriteContext)); | 483 | wc = GNUNET_new (struct WriteContext); |
484 | wc->length = xconfig_size + sizeof (struct GNUNET_TESTBED_HelperReply); | 484 | wc->length = xconfig_size + sizeof (struct GNUNET_TESTBED_HelperReply); |
485 | reply = GNUNET_realloc (xconfig, wc->length); | 485 | reply = GNUNET_realloc (xconfig, wc->length); |
486 | memmove (&reply[1], reply, xconfig_size); | 486 | memmove (&reply[1], reply, xconfig_size); |
diff --git a/src/testbed/gnunet-service-testbed-logger.c b/src/testbed/gnunet-service-testbed-logger.c index dfa9da52f..8129c7cbf 100644 --- a/src/testbed/gnunet-service-testbed-logger.c +++ b/src/testbed/gnunet-service-testbed-logger.c | |||
@@ -145,7 +145,7 @@ queue_message (struct GNUNET_SERVER_Client *client, | |||
145 | 145 | ||
146 | type = ntohs (msg->type); | 146 | type = ntohs (msg->type); |
147 | size = ntohs (msg->size); | 147 | size = ntohs (msg->size); |
148 | mq_entry = GNUNET_malloc (sizeof (struct MessageQueue)); | 148 | mq_entry = GNUNET_new (struct MessageQueue); |
149 | mq_entry->msg = msg; | 149 | mq_entry->msg = msg; |
150 | mq_entry->client = client; | 150 | mq_entry->client = client; |
151 | GNUNET_SERVER_client_keep (client); | 151 | GNUNET_SERVER_client_keep (client); |
diff --git a/src/testbed/gnunet-service-testbed.c b/src/testbed/gnunet-service-testbed.c index 6f806e21b..a1d6aed09 100644 --- a/src/testbed/gnunet-service-testbed.c +++ b/src/testbed/gnunet-service-testbed.c | |||
@@ -191,7 +191,7 @@ GST_queue_message (struct GNUNET_SERVER_Client *client, | |||
191 | size = ntohs (msg->size); | 191 | size = ntohs (msg->size); |
192 | GNUNET_assert ((GNUNET_MESSAGE_TYPE_TESTBED_INIT <= type) && | 192 | GNUNET_assert ((GNUNET_MESSAGE_TYPE_TESTBED_INIT <= type) && |
193 | (GNUNET_MESSAGE_TYPE_TESTBED_MAX > type)); | 193 | (GNUNET_MESSAGE_TYPE_TESTBED_MAX > type)); |
194 | mq_entry = GNUNET_malloc (sizeof (struct MessageQueue)); | 194 | mq_entry = GNUNET_new (struct MessageQueue); |
195 | mq_entry->msg = msg; | 195 | mq_entry->msg = msg; |
196 | mq_entry->client = client; | 196 | mq_entry->client = client; |
197 | GNUNET_SERVER_client_keep (client); | 197 | GNUNET_SERVER_client_keep (client); |
@@ -364,7 +364,7 @@ GST_queue_host_registration (struct Slave *slave, | |||
364 | "Queueing host registration for host %u at %u\n", | 364 | "Queueing host registration for host %u at %u\n", |
365 | GNUNET_TESTBED_host_get_id_ (host), | 365 | GNUNET_TESTBED_host_get_id_ (host), |
366 | GNUNET_TESTBED_host_get_id_ (GST_host_list[slave->host_id])); | 366 | GNUNET_TESTBED_host_get_id_ (GST_host_list[slave->host_id])); |
367 | hr = GNUNET_malloc (sizeof (struct HostRegistration)); | 367 | hr = GNUNET_new (struct HostRegistration); |
368 | hr->cb = cb; | 368 | hr->cb = cb; |
369 | hr->cb_cls = cb_cls; | 369 | hr->cb_cls = cb_cls; |
370 | hr->host = host; | 370 | hr->host = host; |
@@ -525,7 +525,7 @@ handle_init (void *cls, struct GNUNET_SERVER_Client *client, | |||
525 | GNUNET_free (ss_str); | 525 | GNUNET_free (ss_str); |
526 | ss_str = NULL; | 526 | ss_str = NULL; |
527 | } | 527 | } |
528 | GST_context = GNUNET_malloc (sizeof (struct Context)); | 528 | GST_context = GNUNET_new (struct Context); |
529 | GNUNET_SERVER_client_keep (client); | 529 | GNUNET_SERVER_client_keep (client); |
530 | GST_context->client = client; | 530 | GST_context->client = client; |
531 | GST_context->host_id = ntohl (msg->host_id); | 531 | GST_context->host_id = ntohl (msg->host_id); |
diff --git a/src/testbed/gnunet-service-testbed_barriers.c b/src/testbed/gnunet-service-testbed_barriers.c index 482d0ddcd..de2c175f1 100644 --- a/src/testbed/gnunet-service-testbed_barriers.c +++ b/src/testbed/gnunet-service-testbed_barriers.c | |||
@@ -306,7 +306,7 @@ queue_message (struct ClientCtx *ctx, struct GNUNET_MessageHeader *msg) | |||
306 | struct MessageQueue *mq; | 306 | struct MessageQueue *mq; |
307 | struct GNUNET_SERVER_Client *client = ctx->client; | 307 | struct GNUNET_SERVER_Client *client = ctx->client; |
308 | 308 | ||
309 | mq = GNUNET_malloc (sizeof (struct MessageQueue)); | 309 | mq = GNUNET_new (struct MessageQueue); |
310 | mq->msg = msg; | 310 | mq->msg = msg; |
311 | LOG_DEBUG ("Queueing message of type %u, size %u for sending\n", | 311 | LOG_DEBUG ("Queueing message of type %u, size %u for sending\n", |
312 | ntohs (msg->type), ntohs (msg->size)); | 312 | ntohs (msg->type), ntohs (msg->size)); |
@@ -494,7 +494,7 @@ handle_barrier_wait (void *cls, struct GNUNET_SERVER_Client *client, | |||
494 | client_ctx = GNUNET_SERVER_client_get_user_context (client, struct ClientCtx); | 494 | client_ctx = GNUNET_SERVER_client_get_user_context (client, struct ClientCtx); |
495 | if (NULL == client_ctx) | 495 | if (NULL == client_ctx) |
496 | { | 496 | { |
497 | client_ctx = GNUNET_malloc (sizeof (struct ClientCtx)); | 497 | client_ctx = GNUNET_new (struct ClientCtx); |
498 | client_ctx->client = client; | 498 | client_ctx->client = client; |
499 | GNUNET_SERVER_client_keep (client); | 499 | GNUNET_SERVER_client_keep (client); |
500 | client_ctx->barrier = barrier; | 500 | client_ctx->barrier = barrier; |
@@ -747,7 +747,7 @@ GST_handle_barrier_init (void *cls, struct GNUNET_SERVER_Client *client, | |||
747 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 747 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
748 | return; | 748 | return; |
749 | } | 749 | } |
750 | barrier = GNUNET_malloc (sizeof (struct Barrier)); | 750 | barrier = GNUNET_new (struct Barrier); |
751 | (void) memcpy (&barrier->hash, &hash, sizeof (struct GNUNET_HashCode)); | 751 | (void) memcpy (&barrier->hash, &hash, sizeof (struct GNUNET_HashCode)); |
752 | barrier->quorum = msg->quorum; | 752 | barrier->quorum = msg->quorum; |
753 | barrier->name = name; | 753 | barrier->name = name; |
@@ -769,7 +769,7 @@ GST_handle_barrier_init (void *cls, struct GNUNET_SERVER_Client *client, | |||
769 | GNUNET_break (0);/* May happen when we are connecting to the controller */ | 769 | GNUNET_break (0);/* May happen when we are connecting to the controller */ |
770 | continue; | 770 | continue; |
771 | } | 771 | } |
772 | wrapper = GNUNET_malloc (sizeof (struct WBarrier)); | 772 | wrapper = GNUNET_new (struct WBarrier); |
773 | wrapper->barrier = barrier; | 773 | wrapper->barrier = barrier; |
774 | GNUNET_CONTAINER_DLL_insert_tail (barrier->whead, barrier->wtail, wrapper); | 774 | GNUNET_CONTAINER_DLL_insert_tail (barrier->whead, barrier->wtail, wrapper); |
775 | wrapper->hbarrier = GNUNET_TESTBED_barrier_init_ (slave->controller, | 775 | wrapper->hbarrier = GNUNET_TESTBED_barrier_init_ (slave->controller, |
diff --git a/src/testbed/gnunet-service-testbed_cache.c b/src/testbed/gnunet-service-testbed_cache.c index 50ffe7679..7f2a35a7d 100644 --- a/src/testbed/gnunet-service-testbed_cache.c +++ b/src/testbed/gnunet-service-testbed_cache.c | |||
@@ -132,7 +132,7 @@ add_entry (unsigned int peer_id) | |||
132 | entry->peer_id, | 132 | entry->peer_id, |
133 | entry)); | 133 | entry)); |
134 | } | 134 | } |
135 | entry = GNUNET_malloc (sizeof (struct CacheEntry)); | 135 | entry = GNUNET_new (struct CacheEntry); |
136 | entry->peer_id = peer_id; | 136 | entry->peer_id = peer_id; |
137 | GNUNET_assert (GNUNET_OK == | 137 | GNUNET_assert (GNUNET_OK == |
138 | GNUNET_CONTAINER_multihashmap32_put (cache, | 138 | GNUNET_CONTAINER_multihashmap32_put (cache, |
diff --git a/src/testbed/gnunet-service-testbed_links.c b/src/testbed/gnunet-service-testbed_links.c index 766c47471..cb908f12b 100644 --- a/src/testbed/gnunet-service-testbed_links.c +++ b/src/testbed/gnunet-service-testbed_links.c | |||
@@ -970,7 +970,7 @@ GST_neighbour_get_connection (struct Neighbour *n, | |||
970 | GNUNET_assert (NULL != cb); | 970 | GNUNET_assert (NULL != cb); |
971 | LOG_DEBUG ("Attempting to get connection to controller on host %u\n", | 971 | LOG_DEBUG ("Attempting to get connection to controller on host %u\n", |
972 | n->host_id); | 972 | n->host_id); |
973 | h = GNUNET_malloc (sizeof (struct NeighbourConnectNotification)); | 973 | h = GNUNET_new (struct NeighbourConnectNotification); |
974 | h->n = n; | 974 | h->n = n; |
975 | h->cb = cb; | 975 | h->cb = cb; |
976 | h->cb_cls = cb_cls; | 976 | h->cb_cls = cb_cls; |
@@ -1163,7 +1163,7 @@ GST_create_neighbour (struct GNUNET_TESTBED_Host *host) | |||
1163 | { | 1163 | { |
1164 | struct Neighbour *n; | 1164 | struct Neighbour *n; |
1165 | 1165 | ||
1166 | n = GNUNET_malloc (sizeof (struct Neighbour)); | 1166 | n = GNUNET_new (struct Neighbour); |
1167 | n->host_id = GNUNET_TESTBED_host_get_id_ (host); | 1167 | n->host_id = GNUNET_TESTBED_host_get_id_ (host); |
1168 | neighbour_list_add (n); /* just add; connect on-demand */ | 1168 | neighbour_list_add (n); /* just add; connect on-demand */ |
1169 | return n; | 1169 | return n; |
@@ -1249,7 +1249,7 @@ GST_handle_link_controllers (void *cls, struct GNUNET_SERVER_Client *client, | |||
1249 | LOG_DEBUG ("Received request to establish a link to host %u\n", | 1249 | LOG_DEBUG ("Received request to establish a link to host %u\n", |
1250 | delegated_host_id); | 1250 | delegated_host_id); |
1251 | n = GST_create_neighbour (GST_host_list[delegated_host_id]); | 1251 | n = GST_create_neighbour (GST_host_list[delegated_host_id]); |
1252 | ncc = GNUNET_malloc (sizeof (struct NeighbourConnectCtxt)); | 1252 | ncc = GNUNET_new (struct NeighbourConnectCtxt); |
1253 | ncc->n = n; | 1253 | ncc->n = n; |
1254 | ncc->op_id = op_id; | 1254 | ncc->op_id = op_id; |
1255 | ncc->client = client; | 1255 | ncc->client = client; |
@@ -1271,11 +1271,11 @@ GST_handle_link_controllers (void *cls, struct GNUNET_SERVER_Client *client, | |||
1271 | } | 1271 | } |
1272 | LOG_DEBUG ("Received request to start and establish a link to host %u\n", | 1272 | LOG_DEBUG ("Received request to start and establish a link to host %u\n", |
1273 | delegated_host_id); | 1273 | delegated_host_id); |
1274 | slave = GNUNET_malloc (sizeof (struct Slave)); | 1274 | slave = GNUNET_new (struct Slave); |
1275 | slave->host_id = delegated_host_id; | 1275 | slave->host_id = delegated_host_id; |
1276 | slave->reghost_map = GNUNET_CONTAINER_multihashmap_create (100, GNUNET_NO); | 1276 | slave->reghost_map = GNUNET_CONTAINER_multihashmap_create (100, GNUNET_NO); |
1277 | slave_list_add (slave); | 1277 | slave_list_add (slave); |
1278 | lcc = GNUNET_malloc (sizeof (struct LinkControllersContext)); | 1278 | lcc = GNUNET_new (struct LinkControllersContext); |
1279 | lcc->operation_id = op_id; | 1279 | lcc->operation_id = op_id; |
1280 | GNUNET_SERVER_client_keep (client); | 1280 | GNUNET_SERVER_client_keep (client); |
1281 | lcc->client = client; | 1281 | lcc->client = client; |
@@ -1284,7 +1284,7 @@ GST_handle_link_controllers (void *cls, struct GNUNET_SERVER_Client *client, | |||
1284 | GNUNET_TESTBED_controller_start (GST_context->master_ip, | 1284 | GNUNET_TESTBED_controller_start (GST_context->master_ip, |
1285 | GST_host_list[slave->host_id], | 1285 | GST_host_list[slave->host_id], |
1286 | &slave_status_cb, slave); | 1286 | &slave_status_cb, slave); |
1287 | new_route = GNUNET_malloc (sizeof (struct Route)); | 1287 | new_route = GNUNET_new (struct Route); |
1288 | new_route->dest = delegated_host_id; | 1288 | new_route->dest = delegated_host_id; |
1289 | new_route->thru = GST_context->host_id; | 1289 | new_route->thru = GST_context->host_id; |
1290 | route_list_add (new_route); | 1290 | route_list_add (new_route); |
@@ -1298,8 +1298,8 @@ GST_handle_link_controllers (void *cls, struct GNUNET_SERVER_Client *client, | |||
1298 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | 1298 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); |
1299 | return; | 1299 | return; |
1300 | } | 1300 | } |
1301 | lcfq = GNUNET_malloc (sizeof (struct LCFContextQueue)); | 1301 | lcfq = GNUNET_new (struct LCFContextQueue); |
1302 | lcfq->lcf = GNUNET_malloc (sizeof (struct LCFContext)); | 1302 | lcfq->lcf = GNUNET_new (struct LCFContext); |
1303 | lcfq->lcf->delegated_host_id = delegated_host_id; | 1303 | lcfq->lcf->delegated_host_id = delegated_host_id; |
1304 | lcfq->lcf->slave_host_id = slave_host_id; | 1304 | lcfq->lcf->slave_host_id = slave_host_id; |
1305 | route = GST_find_dest_route (slave_host_id); | 1305 | route = GST_find_dest_route (slave_host_id); |
@@ -1335,7 +1335,7 @@ GST_handle_link_controllers (void *cls, struct GNUNET_SERVER_Client *client, | |||
1335 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | 1335 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); |
1336 | return; | 1336 | return; |
1337 | } | 1337 | } |
1338 | new_route = GNUNET_malloc (sizeof (struct Route)); | 1338 | new_route = GNUNET_new (struct Route); |
1339 | new_route->dest = delegated_host_id; | 1339 | new_route->dest = delegated_host_id; |
1340 | new_route->thru = route->dest; | 1340 | new_route->thru = route->dest; |
1341 | route_list_add (new_route); | 1341 | route_list_add (new_route); |
diff --git a/src/testbed/gnunet-service-testbed_oc.c b/src/testbed/gnunet-service-testbed_oc.c index 5ea6e48e1..c2978728c 100644 --- a/src/testbed/gnunet-service-testbed_oc.c +++ b/src/testbed/gnunet-service-testbed_oc.c | |||
@@ -444,7 +444,7 @@ GST_process_next_focc (struct RegisteredHostContext *rhc) | |||
444 | peer = GST_peer_list[focc->peer1]; | 444 | peer = GST_peer_list[focc->peer1]; |
445 | GNUNET_assert (GNUNET_YES == peer->is_remote); | 445 | GNUNET_assert (GNUNET_YES == peer->is_remote); |
446 | GNUNET_assert (NULL != (slave = peer->details.remote.slave)); | 446 | GNUNET_assert (NULL != (slave = peer->details.remote.slave)); |
447 | fopc = GNUNET_malloc (sizeof (struct ForwardedOperationContext)); | 447 | fopc = GNUNET_new (struct ForwardedOperationContext); |
448 | GNUNET_SERVER_client_keep (focc->client); | 448 | GNUNET_SERVER_client_keep (focc->client); |
449 | fopc->client = focc->client; | 449 | fopc->client = focc->client; |
450 | fopc->operation_id = focc->operation_id; | 450 | fopc->operation_id = focc->operation_id; |
@@ -605,7 +605,7 @@ send_overlay_connect_success_msg (struct OverlayConnectContext *occ) | |||
605 | 605 | ||
606 | LOG_DEBUG ("0x%llx: Peers connected - Sending overlay connect success\n", | 606 | LOG_DEBUG ("0x%llx: Peers connected - Sending overlay connect success\n", |
607 | occ->op_id); | 607 | occ->op_id); |
608 | msg = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_ConnectionEventMessage)); | 608 | msg = GNUNET_new (struct GNUNET_TESTBED_ConnectionEventMessage); |
609 | msg->header.size = | 609 | msg->header.size = |
610 | htons (sizeof (struct GNUNET_TESTBED_ConnectionEventMessage)); | 610 | htons (sizeof (struct GNUNET_TESTBED_ConnectionEventMessage)); |
611 | msg->header.type = htons (GNUNET_MESSAGE_TYPE_TESTBED_PEER_CONNECT_EVENT); | 611 | msg->header.type = htons (GNUNET_MESSAGE_TYPE_TESTBED_PEER_CONNECT_EVENT); |
@@ -1223,7 +1223,7 @@ register_host (struct Slave *slave, struct GNUNET_TESTBED_Host *host) | |||
1223 | struct GNUNET_HashCode hash; | 1223 | struct GNUNET_HashCode hash; |
1224 | struct RegisteredHostContext *rhc; | 1224 | struct RegisteredHostContext *rhc; |
1225 | 1225 | ||
1226 | rhc = GNUNET_malloc (sizeof (struct RegisteredHostContext)); | 1226 | rhc = GNUNET_new (struct RegisteredHostContext); |
1227 | rhc->reg_host = host; | 1227 | rhc->reg_host = host; |
1228 | rhc->host = GST_host_list[slave->host_id]; | 1228 | rhc->host = GST_host_list[slave->host_id]; |
1229 | GNUNET_assert (NULL != rhc->reg_host); | 1229 | GNUNET_assert (NULL != rhc->reg_host); |
@@ -1304,7 +1304,7 @@ forward_overlay_connect (const struct GNUNET_TESTBED_OverlayConnectMessage *msg, | |||
1304 | GST_host_list[peer2_host_id]))) | 1304 | GST_host_list[peer2_host_id]))) |
1305 | { | 1305 | { |
1306 | LOG_DEBUG ("Queueing forwarding FOCC for connecting peers %u and %u\n", p1, p2); | 1306 | LOG_DEBUG ("Queueing forwarding FOCC for connecting peers %u and %u\n", p1, p2); |
1307 | focc = GNUNET_malloc (sizeof (struct ForwardedOverlayConnectContext)); | 1307 | focc = GNUNET_new (struct ForwardedOverlayConnectContext); |
1308 | focc->peer1 = p1; | 1308 | focc->peer1 = p1; |
1309 | focc->peer2 = p2; | 1309 | focc->peer2 = p2; |
1310 | focc->peer2_host_id = peer2_host_id; | 1310 | focc->peer2_host_id = peer2_host_id; |
@@ -1319,7 +1319,7 @@ forward_overlay_connect (const struct GNUNET_TESTBED_OverlayConnectMessage *msg, | |||
1319 | 1319 | ||
1320 | forward: | 1320 | forward: |
1321 | LOG_DEBUG ("Forwarding without FOCC for connecting peers %u and %u\n", p1, p2); | 1321 | LOG_DEBUG ("Forwarding without FOCC for connecting peers %u and %u\n", p1, p2); |
1322 | fopc = GNUNET_malloc (sizeof (struct ForwardedOperationContext)); | 1322 | fopc = GNUNET_new (struct ForwardedOperationContext); |
1323 | GNUNET_SERVER_client_keep (client); | 1323 | GNUNET_SERVER_client_keep (client); |
1324 | fopc->client = client; | 1324 | fopc->client = client; |
1325 | fopc->operation_id = op_id; | 1325 | fopc->operation_id = op_id; |
@@ -1429,7 +1429,7 @@ GST_handle_overlay_connect (void *cls, struct GNUNET_SERVER_Client *client, | |||
1429 | return; | 1429 | return; |
1430 | } | 1430 | } |
1431 | p2n = NULL; | 1431 | p2n = NULL; |
1432 | occ = GNUNET_malloc (sizeof (struct OverlayConnectContext)); | 1432 | occ = GNUNET_new (struct OverlayConnectContext); |
1433 | occ->type = OCC_TYPE_LOCAL; | 1433 | occ->type = OCC_TYPE_LOCAL; |
1434 | if (!VALID_PEER_ID (p2)) /* May be peer2 is on a another controller */ | 1434 | if (!VALID_PEER_ID (p2)) /* May be peer2 is on a another controller */ |
1435 | { | 1435 | { |
@@ -1743,7 +1743,7 @@ GST_handle_remote_overlay_connect (void *cls, | |||
1743 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 1743 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
1744 | return; | 1744 | return; |
1745 | } | 1745 | } |
1746 | rocc = GNUNET_malloc (sizeof (struct RemoteOverlayConnectCtx)); | 1746 | rocc = GNUNET_new (struct RemoteOverlayConnectCtx); |
1747 | rocc->op_id = GNUNET_ntohll (msg->operation_id); | 1747 | rocc->op_id = GNUNET_ntohll (msg->operation_id); |
1748 | GNUNET_CONTAINER_DLL_insert_tail (roccq_head, roccq_tail, rocc); | 1748 | GNUNET_CONTAINER_DLL_insert_tail (roccq_head, roccq_tail, rocc); |
1749 | memcpy (&rocc->a_id, &msg->peer_identity, | 1749 | memcpy (&rocc->a_id, &msg->peer_identity, |
diff --git a/src/testbed/testbed_api.c b/src/testbed/testbed_api.c index 2ee17c9e0..a65102ead 100644 --- a/src/testbed/testbed_api.c +++ b/src/testbed/testbed_api.c | |||
@@ -200,7 +200,7 @@ exop_insert (struct GNUNET_TESTBED_Operation *op) | |||
200 | { | 200 | { |
201 | struct ExpireOperationEntry *entry; | 201 | struct ExpireOperationEntry *entry; |
202 | 202 | ||
203 | entry = GNUNET_malloc (sizeof (struct ExpireOperationEntry)); | 203 | entry = GNUNET_new (struct ExpireOperationEntry); |
204 | entry->op = op; | 204 | entry->op = op; |
205 | GNUNET_CONTAINER_DLL_insert_tail (exop_head, exop_tail, entry); | 205 | GNUNET_CONTAINER_DLL_insert_tail (exop_head, exop_tail, entry); |
206 | } | 206 | } |
@@ -737,7 +737,7 @@ handle_peer_config (struct GNUNET_TESTBED_Controller *c, | |||
737 | peer = data->peer; | 737 | peer = data->peer; |
738 | GNUNET_assert (NULL != peer); | 738 | GNUNET_assert (NULL != peer); |
739 | GNUNET_assert (ntohl (msg->peer_id) == peer->unique_id); | 739 | GNUNET_assert (ntohl (msg->peer_id) == peer->unique_id); |
740 | pinfo = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_PeerInformation)); | 740 | pinfo = GNUNET_new (struct GNUNET_TESTBED_PeerInformation); |
741 | pinfo->pit = data->pit; | 741 | pinfo->pit = data->pit; |
742 | cb = data->cb; | 742 | cb = data->cb; |
743 | cb_cls = data->cb_cls; | 743 | cb_cls = data->cb_cls; |
@@ -747,7 +747,7 @@ handle_peer_config (struct GNUNET_TESTBED_Controller *c, | |||
747 | switch (pinfo->pit) | 747 | switch (pinfo->pit) |
748 | { | 748 | { |
749 | case GNUNET_TESTBED_PIT_IDENTITY: | 749 | case GNUNET_TESTBED_PIT_IDENTITY: |
750 | pinfo->result.id = GNUNET_malloc (sizeof (struct GNUNET_PeerIdentity)); | 750 | pinfo->result.id = GNUNET_new (struct GNUNET_PeerIdentity); |
751 | (void) memcpy (pinfo->result.id, &msg->peer_identity, | 751 | (void) memcpy (pinfo->result.id, &msg->peer_identity, |
752 | sizeof (struct GNUNET_PeerIdentity)); | 752 | sizeof (struct GNUNET_PeerIdentity)); |
753 | break; | 753 | break; |
@@ -1253,7 +1253,7 @@ GNUNET_TESTBED_queue_message_ (struct GNUNET_TESTBED_Controller *controller, | |||
1253 | size = ntohs (msg->size); | 1253 | size = ntohs (msg->size); |
1254 | GNUNET_assert ((GNUNET_MESSAGE_TYPE_TESTBED_INIT <= type) && | 1254 | GNUNET_assert ((GNUNET_MESSAGE_TYPE_TESTBED_INIT <= type) && |
1255 | (GNUNET_MESSAGE_TYPE_TESTBED_MAX > type)); | 1255 | (GNUNET_MESSAGE_TYPE_TESTBED_MAX > type)); |
1256 | mq_entry = GNUNET_malloc (sizeof (struct MessageQueue)); | 1256 | mq_entry = GNUNET_new (struct MessageQueue); |
1257 | mq_entry->msg = msg; | 1257 | mq_entry->msg = msg; |
1258 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1258 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1259 | "Queueing message of type %u, size %u for sending\n", type, | 1259 | "Queueing message of type %u, size %u for sending\n", type, |
@@ -1295,10 +1295,10 @@ GNUNET_TESTBED_forward_operation_msg_ (struct GNUNET_TESTBED_Controller | |||
1295 | struct GNUNET_MessageHeader *dup_msg; | 1295 | struct GNUNET_MessageHeader *dup_msg; |
1296 | uint16_t msize; | 1296 | uint16_t msize; |
1297 | 1297 | ||
1298 | data = GNUNET_malloc (sizeof (struct ForwardedOperationData)); | 1298 | data = GNUNET_new (struct ForwardedOperationData); |
1299 | data->cc = cc; | 1299 | data->cc = cc; |
1300 | data->cc_cls = cc_cls; | 1300 | data->cc_cls = cc_cls; |
1301 | opc = GNUNET_malloc (sizeof (struct OperationContext)); | 1301 | opc = GNUNET_new (struct OperationContext); |
1302 | opc->c = controller; | 1302 | opc->c = controller; |
1303 | opc->type = OP_FORWARDED; | 1303 | opc->type = OP_FORWARDED; |
1304 | opc->data = data; | 1304 | opc->data = data; |
@@ -1482,7 +1482,7 @@ GNUNET_TESTBED_controller_connect (struct GNUNET_TESTBED_Host *host, | |||
1482 | GNUNET_break (0); | 1482 | GNUNET_break (0); |
1483 | return NULL; | 1483 | return NULL; |
1484 | } | 1484 | } |
1485 | controller = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_Controller)); | 1485 | controller = GNUNET_new (struct GNUNET_TESTBED_Controller); |
1486 | controller->cc = cc; | 1486 | controller->cc = cc; |
1487 | controller->cc_cls = cc_cls; | 1487 | controller->cc_cls = cc_cls; |
1488 | controller->event_mask = event_mask; | 1488 | controller->event_mask = event_mask; |
@@ -1706,10 +1706,10 @@ GNUNET_TESTBED_controller_link (void *op_cls, | |||
1706 | msg->delegated_host_id = htonl (delegated_host_id); | 1706 | msg->delegated_host_id = htonl (delegated_host_id); |
1707 | msg->slave_host_id = htonl (slave_host_id); | 1707 | msg->slave_host_id = htonl (slave_host_id); |
1708 | msg->is_subordinate = (GNUNET_YES == is_subordinate) ? 1 : 0; | 1708 | msg->is_subordinate = (GNUNET_YES == is_subordinate) ? 1 : 0; |
1709 | data = GNUNET_malloc (sizeof (struct ControllerLinkData)); | 1709 | data = GNUNET_new (struct ControllerLinkData); |
1710 | data->msg = msg; | 1710 | data->msg = msg; |
1711 | data->host_id = delegated_host_id; | 1711 | data->host_id = delegated_host_id; |
1712 | opc = GNUNET_malloc (sizeof (struct OperationContext)); | 1712 | opc = GNUNET_new (struct OperationContext); |
1713 | opc->c = master; | 1713 | opc->c = master; |
1714 | opc->data = data; | 1714 | opc->data = data; |
1715 | opc->type = OP_LINK_CONTROLLERS; | 1715 | opc->type = OP_LINK_CONTROLLERS; |
@@ -1747,9 +1747,9 @@ GNUNET_TESTBED_get_slave_config_ (void *op_cls, | |||
1747 | struct OperationContext *opc; | 1747 | struct OperationContext *opc; |
1748 | struct GetSlaveConfigData *data; | 1748 | struct GetSlaveConfigData *data; |
1749 | 1749 | ||
1750 | data = GNUNET_malloc (sizeof (struct GetSlaveConfigData)); | 1750 | data = GNUNET_new (struct GetSlaveConfigData); |
1751 | data->slave_id = slave_host_id; | 1751 | data->slave_id = slave_host_id; |
1752 | opc = GNUNET_malloc (sizeof (struct OperationContext)); | 1752 | opc = GNUNET_new (struct OperationContext); |
1753 | opc->state = OPC_STATE_INIT; | 1753 | opc->state = OPC_STATE_INIT; |
1754 | opc->c = master; | 1754 | opc->c = master; |
1755 | opc->id = GNUNET_TESTBED_get_next_op_id (master); | 1755 | opc->id = GNUNET_TESTBED_get_next_op_id (master); |
@@ -2076,7 +2076,7 @@ opstart_shutdown_peers (void *cls) | |||
2076 | struct GNUNET_TESTBED_ShutdownPeersMessage *msg; | 2076 | struct GNUNET_TESTBED_ShutdownPeersMessage *msg; |
2077 | 2077 | ||
2078 | opc->state = OPC_STATE_STARTED; | 2078 | opc->state = OPC_STATE_STARTED; |
2079 | msg = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_ShutdownPeersMessage)); | 2079 | msg = GNUNET_new (struct GNUNET_TESTBED_ShutdownPeersMessage); |
2080 | msg->header.size = | 2080 | msg->header.size = |
2081 | htons (sizeof (struct GNUNET_TESTBED_ShutdownPeersMessage)); | 2081 | htons (sizeof (struct GNUNET_TESTBED_ShutdownPeersMessage)); |
2082 | msg->header.type = htons (GNUNET_MESSAGE_TYPE_TESTBED_SHUTDOWN_PEERS); | 2082 | msg->header.type = htons (GNUNET_MESSAGE_TYPE_TESTBED_SHUTDOWN_PEERS); |
@@ -2137,10 +2137,10 @@ GNUNET_TESTBED_shutdown_peers (struct GNUNET_TESTBED_Controller *c, | |||
2137 | 2137 | ||
2138 | if (0 != GNUNET_CONTAINER_multihashmap32_size (c->opc_map)) | 2138 | if (0 != GNUNET_CONTAINER_multihashmap32_size (c->opc_map)) |
2139 | return NULL; | 2139 | return NULL; |
2140 | data = GNUNET_malloc (sizeof (struct ShutdownPeersData)); | 2140 | data = GNUNET_new (struct ShutdownPeersData); |
2141 | data->cb = cb; | 2141 | data->cb = cb; |
2142 | data->cb_cls = cb_cls; | 2142 | data->cb_cls = cb_cls; |
2143 | opc = GNUNET_malloc (sizeof (struct OperationContext)); | 2143 | opc = GNUNET_new (struct OperationContext); |
2144 | opc->c = c; | 2144 | opc->c = c; |
2145 | opc->op_cls = op_cls; | 2145 | opc->op_cls = op_cls; |
2146 | opc->data = data; | 2146 | opc->data = data; |
diff --git a/src/testbed/testbed_api_barriers.c b/src/testbed/testbed_api_barriers.c index 2ec34bb1b..e407b173e 100644 --- a/src/testbed/testbed_api_barriers.c +++ b/src/testbed/testbed_api_barriers.c | |||
@@ -234,7 +234,7 @@ GNUNET_TESTBED_barrier_init_ (struct GNUNET_TESTBED_Controller *controller, | |||
234 | return NULL; | 234 | return NULL; |
235 | } | 235 | } |
236 | LOG_DEBUG ("Initialising barrier `%s'\n", name); | 236 | LOG_DEBUG ("Initialising barrier `%s'\n", name); |
237 | barrier = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_Barrier)); | 237 | barrier = GNUNET_new (struct GNUNET_TESTBED_Barrier); |
238 | barrier->c = controller; | 238 | barrier->c = controller; |
239 | barrier->name = GNUNET_strdup (name); | 239 | barrier->name = GNUNET_strdup (name); |
240 | barrier->cb = cb; | 240 | barrier->cb = cb; |
@@ -488,7 +488,7 @@ GNUNET_TESTBED_barrier_wait (const char *name, | |||
488 | GNUNET_CONFIGURATION_destroy (cfg); | 488 | GNUNET_CONFIGURATION_destroy (cfg); |
489 | return NULL; | 489 | return NULL; |
490 | } | 490 | } |
491 | h = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_BarrierWaitHandle)); | 491 | h = GNUNET_new (struct GNUNET_TESTBED_BarrierWaitHandle); |
492 | h->name = GNUNET_strdup (name); | 492 | h->name = GNUNET_strdup (name); |
493 | h->cfg = cfg; | 493 | h->cfg = cfg; |
494 | h->conn = GNUNET_CLIENT_connect ("testbed-barrier", h->cfg); | 494 | h->conn = GNUNET_CLIENT_connect ("testbed-barrier", h->cfg); |
diff --git a/src/testbed/testbed_api_hosts.c b/src/testbed/testbed_api_hosts.c index 8af8e23d0..5a5b00e5a 100644 --- a/src/testbed/testbed_api_hosts.c +++ b/src/testbed/testbed_api_hosts.c | |||
@@ -331,7 +331,7 @@ GNUNET_TESTBED_host_create_with_id (uint32_t id, const char *hostname, | |||
331 | LOG (GNUNET_ERROR_TYPE_WARNING, "Host with id: %u already created\n", id); | 331 | LOG (GNUNET_ERROR_TYPE_WARNING, "Host with id: %u already created\n", id); |
332 | return NULL; | 332 | return NULL; |
333 | } | 333 | } |
334 | host = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_Host)); | 334 | host = GNUNET_new (struct GNUNET_TESTBED_Host); |
335 | host->hostname = (NULL != hostname) ? GNUNET_strdup (hostname) : NULL; | 335 | host->hostname = (NULL != hostname) ? GNUNET_strdup (hostname) : NULL; |
336 | host->username = (NULL != username) ? GNUNET_strdup (username) : NULL; | 336 | host->username = (NULL != username) ? GNUNET_strdup (username) : NULL; |
337 | host->id = id; | 337 | host->id = id; |
@@ -649,7 +649,7 @@ GNUNET_TESTBED_mark_host_registered_at_ (struct GNUNET_TESTBED_Host *host, | |||
649 | return; | 649 | return; |
650 | } | 650 | } |
651 | } | 651 | } |
652 | rc = GNUNET_malloc (sizeof (struct RegisteredController)); | 652 | rc = GNUNET_new (struct RegisteredController); |
653 | rc->controller = controller; | 653 | rc->controller = controller; |
654 | GNUNET_CONTAINER_DLL_insert_tail (host->rc_head, host->rc_tail, rc); | 654 | GNUNET_CONTAINER_DLL_insert_tail (host->rc_head, host->rc_tail, rc); |
655 | } | 655 | } |
@@ -1079,7 +1079,7 @@ GNUNET_TESTBED_controller_start (const char *trusted_ip, | |||
1079 | host->locked = GNUNET_YES; | 1079 | host->locked = GNUNET_YES; |
1080 | API_VIOLATION (GNUNET_NO == host->controller_started, | 1080 | API_VIOLATION (GNUNET_NO == host->controller_started, |
1081 | "Attempting to start a controller on a host which is already started a controller"); | 1081 | "Attempting to start a controller on a host which is already started a controller"); |
1082 | cp = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_ControllerProc)); | 1082 | cp = GNUNET_new (struct GNUNET_TESTBED_ControllerProc); |
1083 | if (0 == GNUNET_TESTBED_host_get_id_ (host)) | 1083 | if (0 == GNUNET_TESTBED_host_get_id_ (host)) |
1084 | { | 1084 | { |
1085 | cp->helper = | 1085 | cp->helper = |
@@ -1324,7 +1324,7 @@ GNUNET_TESTBED_is_host_habitable (const struct GNUNET_TESTBED_Host *host, | |||
1324 | const char *hostname; | 1324 | const char *hostname; |
1325 | char *port; | 1325 | char *port; |
1326 | 1326 | ||
1327 | h = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_HostHabitableCheckHandle)); | 1327 | h = GNUNET_new (struct GNUNET_TESTBED_HostHabitableCheckHandle); |
1328 | h->cb = cb; | 1328 | h->cb = cb; |
1329 | h->cb_cls = cb_cls; | 1329 | h->cb_cls = cb_cls; |
1330 | h->host = host; | 1330 | h->host = host; |
@@ -1449,7 +1449,7 @@ GNUNET_TESTBED_register_host (struct GNUNET_TESTBED_Controller *controller, | |||
1449 | (NULL == hostname) ? "localhost" : hostname); | 1449 | (NULL == hostname) ? "localhost" : hostname); |
1450 | return NULL; | 1450 | return NULL; |
1451 | } | 1451 | } |
1452 | rh = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_HostRegistrationHandle)); | 1452 | rh = GNUNET_new (struct GNUNET_TESTBED_HostRegistrationHandle); |
1453 | rh->host = host; | 1453 | rh->host = host; |
1454 | rh->c = controller; | 1454 | rh->c = controller; |
1455 | GNUNET_assert (NULL != cc); | 1455 | GNUNET_assert (NULL != cc); |
diff --git a/src/testbed/testbed_api_operations.c b/src/testbed/testbed_api_operations.c index ce2ef5715..2a559a90e 100644 --- a/src/testbed/testbed_api_operations.c +++ b/src/testbed/testbed_api_operations.c | |||
@@ -455,7 +455,7 @@ change_state (struct GNUNET_TESTBED_Operation *op, enum OperationState state) | |||
455 | { | 455 | { |
456 | if (OP_STATE_INIT == op->state) | 456 | if (OP_STATE_INIT == op->state) |
457 | { | 457 | { |
458 | entry = GNUNET_malloc (sizeof (struct QueueEntry)); | 458 | entry = GNUNET_new (struct QueueEntry); |
459 | entry->op = op; | 459 | entry->op = op; |
460 | entry->nres = op->nres[cnt]; | 460 | entry->nres = op->nres[cnt]; |
461 | s = cnt; | 461 | s = cnt; |
@@ -557,7 +557,7 @@ rq_add (struct GNUNET_TESTBED_Operation *op) | |||
557 | struct ReadyQueueEntry *rq_entry; | 557 | struct ReadyQueueEntry *rq_entry; |
558 | 558 | ||
559 | GNUNET_assert (NULL == op->rq_entry); | 559 | GNUNET_assert (NULL == op->rq_entry); |
560 | rq_entry = GNUNET_malloc (sizeof (struct ReadyQueueEntry)); | 560 | rq_entry = GNUNET_new (struct ReadyQueueEntry); |
561 | rq_entry->op = op; | 561 | rq_entry->op = op; |
562 | GNUNET_CONTAINER_DLL_insert_tail (rq_head, rq_tail, rq_entry); | 562 | GNUNET_CONTAINER_DLL_insert_tail (rq_head, rq_tail, rq_entry); |
563 | op->rq_entry = rq_entry; | 563 | op->rq_entry = rq_entry; |
@@ -970,7 +970,7 @@ GNUNET_TESTBED_operation_create_ (void *cls, OperationStart start, | |||
970 | { | 970 | { |
971 | struct GNUNET_TESTBED_Operation *op; | 971 | struct GNUNET_TESTBED_Operation *op; |
972 | 972 | ||
973 | op = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_Operation)); | 973 | op = GNUNET_new (struct GNUNET_TESTBED_Operation); |
974 | op->start = start; | 974 | op->start = start; |
975 | op->state = OP_STATE_INIT; | 975 | op->state = OP_STATE_INIT; |
976 | op->release = release; | 976 | op->release = release; |
@@ -994,7 +994,7 @@ GNUNET_TESTBED_operation_queue_create_ (enum OperationQueueType type, | |||
994 | struct OperationQueue *queue; | 994 | struct OperationQueue *queue; |
995 | struct FeedbackCtx *fctx; | 995 | struct FeedbackCtx *fctx; |
996 | 996 | ||
997 | queue = GNUNET_malloc (sizeof (struct OperationQueue)); | 997 | queue = GNUNET_new (struct OperationQueue); |
998 | queue->type = type; | 998 | queue->type = type; |
999 | if (OPERATION_QUEUE_TYPE_FIXED == type) | 999 | if (OPERATION_QUEUE_TYPE_FIXED == type) |
1000 | { | 1000 | { |
@@ -1002,7 +1002,7 @@ GNUNET_TESTBED_operation_queue_create_ (enum OperationQueueType type, | |||
1002 | } | 1002 | } |
1003 | else | 1003 | else |
1004 | { | 1004 | { |
1005 | fctx = GNUNET_malloc (sizeof (struct FeedbackCtx)); | 1005 | fctx = GNUNET_new (struct FeedbackCtx); |
1006 | fctx->max_active_bound = max_active; | 1006 | fctx->max_active_bound = max_active; |
1007 | fctx->sd = GNUNET_TESTBED_SD_init_ (10); /* FIXME: Why 10? */ | 1007 | fctx->sd = GNUNET_TESTBED_SD_init_ (10); /* FIXME: Why 10? */ |
1008 | queue->fctx = fctx; | 1008 | queue->fctx = fctx; |
diff --git a/src/testbed/testbed_api_peers.c b/src/testbed/testbed_api_peers.c index 5d55e3ef6..a8a87c057 100644 --- a/src/testbed/testbed_api_peers.c +++ b/src/testbed/testbed_api_peers.c | |||
@@ -167,7 +167,7 @@ opstart_peer_destroy (void *cls) | |||
167 | GNUNET_assert (OP_PEER_DESTROY == opc->type); | 167 | GNUNET_assert (OP_PEER_DESTROY == opc->type); |
168 | GNUNET_assert (NULL != peer); | 168 | GNUNET_assert (NULL != peer); |
169 | opc->state = OPC_STATE_STARTED; | 169 | opc->state = OPC_STATE_STARTED; |
170 | msg = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_PeerDestroyMessage)); | 170 | msg = GNUNET_new (struct GNUNET_TESTBED_PeerDestroyMessage); |
171 | msg->header.size = htons (sizeof (struct GNUNET_TESTBED_PeerDestroyMessage)); | 171 | msg->header.size = htons (sizeof (struct GNUNET_TESTBED_PeerDestroyMessage)); |
172 | msg->header.type = htons (GNUNET_MESSAGE_TYPE_TESTBED_DESTROY_PEER); | 172 | msg->header.type = htons (GNUNET_MESSAGE_TYPE_TESTBED_DESTROY_PEER); |
173 | msg->peer_id = htonl (peer->unique_id); | 173 | msg->peer_id = htonl (peer->unique_id); |
@@ -219,7 +219,7 @@ opstart_peer_start (void *cls) | |||
219 | GNUNET_assert (NULL != (peer = data->peer)); | 219 | GNUNET_assert (NULL != (peer = data->peer)); |
220 | GNUNET_assert ((TESTBED_PS_CREATED == peer->state) || (TESTBED_PS_STOPPED == peer->state)); | 220 | GNUNET_assert ((TESTBED_PS_CREATED == peer->state) || (TESTBED_PS_STOPPED == peer->state)); |
221 | opc->state = OPC_STATE_STARTED; | 221 | opc->state = OPC_STATE_STARTED; |
222 | msg = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_PeerStartMessage)); | 222 | msg = GNUNET_new (struct GNUNET_TESTBED_PeerStartMessage); |
223 | msg->header.size = htons (sizeof (struct GNUNET_TESTBED_PeerStartMessage)); | 223 | msg->header.size = htons (sizeof (struct GNUNET_TESTBED_PeerStartMessage)); |
224 | msg->header.type = htons (GNUNET_MESSAGE_TYPE_TESTBED_START_PEER); | 224 | msg->header.type = htons (GNUNET_MESSAGE_TYPE_TESTBED_START_PEER); |
225 | msg->peer_id = htonl (peer->unique_id); | 225 | msg->peer_id = htonl (peer->unique_id); |
@@ -271,7 +271,7 @@ opstart_peer_stop (void *cls) | |||
271 | GNUNET_assert (NULL != (peer = data->peer)); | 271 | GNUNET_assert (NULL != (peer = data->peer)); |
272 | GNUNET_assert (TESTBED_PS_STARTED == peer->state); | 272 | GNUNET_assert (TESTBED_PS_STARTED == peer->state); |
273 | opc->state = OPC_STATE_STARTED; | 273 | opc->state = OPC_STATE_STARTED; |
274 | msg = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_PeerStopMessage)); | 274 | msg = GNUNET_new (struct GNUNET_TESTBED_PeerStopMessage); |
275 | msg->header.type = htons (GNUNET_MESSAGE_TYPE_TESTBED_STOP_PEER); | 275 | msg->header.type = htons (GNUNET_MESSAGE_TYPE_TESTBED_STOP_PEER); |
276 | msg->header.size = htons (sizeof (struct GNUNET_TESTBED_PeerStopMessage)); | 276 | msg->header.size = htons (sizeof (struct GNUNET_TESTBED_PeerStopMessage)); |
277 | msg->peer_id = htonl (peer->unique_id); | 277 | msg->peer_id = htonl (peer->unique_id); |
@@ -410,7 +410,7 @@ opstart_overlay_connect (void *cls) | |||
410 | opc->state = OPC_STATE_STARTED; | 410 | opc->state = OPC_STATE_STARTED; |
411 | data = opc->data; | 411 | data = opc->data; |
412 | GNUNET_assert (NULL != data); | 412 | GNUNET_assert (NULL != data); |
413 | msg = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_OverlayConnectMessage)); | 413 | msg = GNUNET_new (struct GNUNET_TESTBED_OverlayConnectMessage); |
414 | msg->header.size = | 414 | msg->header.size = |
415 | htons (sizeof (struct GNUNET_TESTBED_OverlayConnectMessage)); | 415 | htons (sizeof (struct GNUNET_TESTBED_OverlayConnectMessage)); |
416 | msg->header.type = htons (GNUNET_MESSAGE_TYPE_TESTBED_OVERLAY_CONNECT); | 416 | msg->header.type = htons (GNUNET_MESSAGE_TYPE_TESTBED_OVERLAY_CONNECT); |
@@ -570,18 +570,18 @@ GNUNET_TESTBED_peer_create (struct GNUNET_TESTBED_Controller *controller, | |||
570 | struct OperationContext *opc; | 570 | struct OperationContext *opc; |
571 | static uint32_t id_gen; | 571 | static uint32_t id_gen; |
572 | 572 | ||
573 | peer = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_Peer)); | 573 | peer = GNUNET_new (struct GNUNET_TESTBED_Peer); |
574 | peer->controller = controller; | 574 | peer->controller = controller; |
575 | peer->host = host; | 575 | peer->host = host; |
576 | peer->unique_id = id_gen++; | 576 | peer->unique_id = id_gen++; |
577 | peer->state = TESTBED_PS_INVALID; | 577 | peer->state = TESTBED_PS_INVALID; |
578 | data = GNUNET_malloc (sizeof (struct PeerCreateData)); | 578 | data = GNUNET_new (struct PeerCreateData); |
579 | data->host = host; | 579 | data->host = host; |
580 | data->cfg = cfg; | 580 | data->cfg = cfg; |
581 | data->cb = cb; | 581 | data->cb = cb; |
582 | data->cls = cls; | 582 | data->cls = cls; |
583 | data->peer = peer; | 583 | data->peer = peer; |
584 | opc = GNUNET_malloc (sizeof (struct OperationContext)); | 584 | opc = GNUNET_new (struct OperationContext); |
585 | opc->c = controller; | 585 | opc->c = controller; |
586 | opc->data = data; | 586 | opc->data = data; |
587 | opc->id = GNUNET_TESTBED_get_next_op_id (controller); | 587 | opc->id = GNUNET_TESTBED_get_next_op_id (controller); |
@@ -613,11 +613,11 @@ GNUNET_TESTBED_peer_start (void *op_cls, struct GNUNET_TESTBED_Peer *peer, | |||
613 | struct OperationContext *opc; | 613 | struct OperationContext *opc; |
614 | struct PeerEventData *data; | 614 | struct PeerEventData *data; |
615 | 615 | ||
616 | data = GNUNET_malloc (sizeof (struct PeerEventData)); | 616 | data = GNUNET_new (struct PeerEventData); |
617 | data->peer = peer; | 617 | data->peer = peer; |
618 | data->pcc = pcc; | 618 | data->pcc = pcc; |
619 | data->pcc_cls = pcc_cls; | 619 | data->pcc_cls = pcc_cls; |
620 | opc = GNUNET_malloc (sizeof (struct OperationContext)); | 620 | opc = GNUNET_new (struct OperationContext); |
621 | opc->c = peer->controller; | 621 | opc->c = peer->controller; |
622 | opc->data = data; | 622 | opc->data = data; |
623 | opc->op_cls = op_cls; | 623 | opc->op_cls = op_cls; |
@@ -653,11 +653,11 @@ GNUNET_TESTBED_peer_stop (void *op_cls, | |||
653 | struct OperationContext *opc; | 653 | struct OperationContext *opc; |
654 | struct PeerEventData *data; | 654 | struct PeerEventData *data; |
655 | 655 | ||
656 | data = GNUNET_malloc (sizeof (struct PeerEventData)); | 656 | data = GNUNET_new (struct PeerEventData); |
657 | data->peer = peer; | 657 | data->peer = peer; |
658 | data->pcc = pcc; | 658 | data->pcc = pcc; |
659 | data->pcc_cls = pcc_cls; | 659 | data->pcc_cls = pcc_cls; |
660 | opc = GNUNET_malloc (sizeof (struct OperationContext)); | 660 | opc = GNUNET_new (struct OperationContext); |
661 | opc->c = peer->controller; | 661 | opc->c = peer->controller; |
662 | opc->data = data; | 662 | opc->data = data; |
663 | opc->op_cls = op_cls; | 663 | opc->op_cls = op_cls; |
@@ -698,12 +698,12 @@ GNUNET_TESTBED_peer_get_information (struct GNUNET_TESTBED_Peer *peer, | |||
698 | 698 | ||
699 | GNUNET_assert (GNUNET_TESTBED_PIT_GENERIC != pit); | 699 | GNUNET_assert (GNUNET_TESTBED_PIT_GENERIC != pit); |
700 | GNUNET_assert (NULL != cb); | 700 | GNUNET_assert (NULL != cb); |
701 | data = GNUNET_malloc (sizeof (struct PeerInfoData)); | 701 | data = GNUNET_new (struct PeerInfoData); |
702 | data->peer = peer; | 702 | data->peer = peer; |
703 | data->pit = pit; | 703 | data->pit = pit; |
704 | data->cb = cb; | 704 | data->cb = cb; |
705 | data->cb_cls = cb_cls; | 705 | data->cb_cls = cb_cls; |
706 | opc = GNUNET_malloc (sizeof (struct OperationContext)); | 706 | opc = GNUNET_new (struct OperationContext); |
707 | opc->c = peer->controller; | 707 | opc->c = peer->controller; |
708 | opc->data = data; | 708 | opc->data = data; |
709 | opc->type = OP_PEER_INFO; | 709 | opc->type = OP_PEER_INFO; |
@@ -737,7 +737,7 @@ GNUNET_TESTBED_peer_update_configuration (struct GNUNET_TESTBED_Peer *peer, | |||
737 | struct PeerReconfigureData *data; | 737 | struct PeerReconfigureData *data; |
738 | size_t csize; | 738 | size_t csize; |
739 | 739 | ||
740 | data = GNUNET_malloc (sizeof (struct PeerReconfigureData)); | 740 | data = GNUNET_new (struct PeerReconfigureData); |
741 | data->peer = peer; | 741 | data->peer = peer; |
742 | data->config = GNUNET_CONFIGURATION_serialize (cfg, &csize); | 742 | data->config = GNUNET_CONFIGURATION_serialize (cfg, &csize); |
743 | if (NULL == data->config) | 743 | if (NULL == data->config) |
@@ -753,7 +753,7 @@ GNUNET_TESTBED_peer_update_configuration (struct GNUNET_TESTBED_Peer *peer, | |||
753 | return NULL; | 753 | return NULL; |
754 | } | 754 | } |
755 | data->cfg_size = (uint16_t) csize; | 755 | data->cfg_size = (uint16_t) csize; |
756 | opc = GNUNET_malloc (sizeof (struct OperationContext)); | 756 | opc = GNUNET_new (struct OperationContext); |
757 | opc->c = peer->controller; | 757 | opc->c = peer->controller; |
758 | opc->data = data; | 758 | opc->data = data; |
759 | opc->type = OP_PEER_RECONFIGURE; | 759 | opc->type = OP_PEER_RECONFIGURE; |
@@ -780,7 +780,7 @@ GNUNET_TESTBED_peer_destroy (struct GNUNET_TESTBED_Peer *peer) | |||
780 | { | 780 | { |
781 | struct OperationContext *opc; | 781 | struct OperationContext *opc; |
782 | 782 | ||
783 | opc = GNUNET_malloc (sizeof (struct OperationContext)); | 783 | opc = GNUNET_new (struct OperationContext); |
784 | opc->data = peer; | 784 | opc->data = peer; |
785 | opc->c = peer->controller; | 785 | opc->c = peer->controller; |
786 | opc->id = GNUNET_TESTBED_get_next_op_id (peer->controller); | 786 | opc->id = GNUNET_TESTBED_get_next_op_id (peer->controller); |
@@ -843,12 +843,12 @@ GNUNET_TESTBED_overlay_connect (void *op_cls, | |||
843 | struct OverlayConnectData *data; | 843 | struct OverlayConnectData *data; |
844 | 844 | ||
845 | GNUNET_assert ((TESTBED_PS_STARTED == p1->state) && (TESTBED_PS_STARTED == p2->state)); | 845 | GNUNET_assert ((TESTBED_PS_STARTED == p1->state) && (TESTBED_PS_STARTED == p2->state)); |
846 | data = GNUNET_malloc (sizeof (struct OverlayConnectData)); | 846 | data = GNUNET_new (struct OverlayConnectData); |
847 | data->p1 = p1; | 847 | data->p1 = p1; |
848 | data->p2 = p2; | 848 | data->p2 = p2; |
849 | data->cb = cb; | 849 | data->cb = cb; |
850 | data->cb_cls = cb_cls; | 850 | data->cb_cls = cb_cls; |
851 | opc = GNUNET_malloc (sizeof (struct OperationContext)); | 851 | opc = GNUNET_new (struct OperationContext); |
852 | opc->data = data; | 852 | opc->data = data; |
853 | opc->c = p1->controller; | 853 | opc->c = p1->controller; |
854 | opc->id = GNUNET_TESTBED_get_next_op_id (opc->c); | 854 | opc->id = GNUNET_TESTBED_get_next_op_id (opc->c); |
@@ -953,14 +953,14 @@ GNUNET_TESTBED_peer_manage_service (void *op_cls, | |||
953 | msize += sizeof (struct GNUNET_TESTBED_ManagePeerServiceMessage); | 953 | msize += sizeof (struct GNUNET_TESTBED_ManagePeerServiceMessage); |
954 | if (GNUNET_SERVER_MAX_MESSAGE_SIZE < msize) | 954 | if (GNUNET_SERVER_MAX_MESSAGE_SIZE < msize) |
955 | return NULL; | 955 | return NULL; |
956 | data = GNUNET_malloc (sizeof (struct ManageServiceData)); | 956 | data = GNUNET_new (struct ManageServiceData); |
957 | data->cb = cb; | 957 | data->cb = cb; |
958 | data->cb_cls = cb_cls; | 958 | data->cb_cls = cb_cls; |
959 | data->peer = peer; | 959 | data->peer = peer; |
960 | data->service_name = GNUNET_strdup (service_name); | 960 | data->service_name = GNUNET_strdup (service_name); |
961 | data->start = start; | 961 | data->start = start; |
962 | data->msize = (uint16_t) msize; | 962 | data->msize = (uint16_t) msize; |
963 | opc = GNUNET_malloc (sizeof (struct OperationContext)); | 963 | opc = GNUNET_new (struct OperationContext); |
964 | opc->data = data; | 964 | opc->data = data; |
965 | opc->c = peer->controller; | 965 | opc->c = peer->controller; |
966 | opc->id = GNUNET_TESTBED_get_next_op_id (opc->c); | 966 | opc->id = GNUNET_TESTBED_get_next_op_id (opc->c); |
diff --git a/src/testbed/testbed_api_sd.c b/src/testbed/testbed_api_sd.c index 7a1da6b80..08f697248 100644 --- a/src/testbed/testbed_api_sd.c +++ b/src/testbed/testbed_api_sd.c | |||
@@ -109,7 +109,7 @@ GNUNET_TESTBED_SD_init_ (unsigned int max_cnt) | |||
109 | struct SDHandle *h; | 109 | struct SDHandle *h; |
110 | 110 | ||
111 | GNUNET_assert (1 < max_cnt); | 111 | GNUNET_assert (1 < max_cnt); |
112 | h = GNUNET_malloc (sizeof (struct SDHandle)); | 112 | h = GNUNET_new (struct SDHandle); |
113 | h->max_cnt = max_cnt; | 113 | h->max_cnt = max_cnt; |
114 | return h; | 114 | return h; |
115 | } | 115 | } |
@@ -159,7 +159,7 @@ GNUNET_TESTBED_SD_add_data_ (struct SDHandle *h, unsigned int amount) | |||
159 | } | 159 | } |
160 | GNUNET_assert (h->cnt < h->max_cnt); | 160 | GNUNET_assert (h->cnt < h->max_cnt); |
161 | if (NULL == entry) | 161 | if (NULL == entry) |
162 | entry = GNUNET_malloc (sizeof (struct SDEntry)); | 162 | entry = GNUNET_new (struct SDEntry); |
163 | entry->amount = amount; | 163 | entry->amount = amount; |
164 | GNUNET_CONTAINER_DLL_insert_tail (h->head, h->tail, entry); | 164 | GNUNET_CONTAINER_DLL_insert_tail (h->head, h->tail, entry); |
165 | h->sum += amount; | 165 | h->sum += amount; |
diff --git a/src/testbed/testbed_api_services.c b/src/testbed/testbed_api_services.c index 86ec284ed..2c390719e 100644 --- a/src/testbed/testbed_api_services.c +++ b/src/testbed/testbed_api_services.c | |||
@@ -263,7 +263,7 @@ GNUNET_TESTBED_service_connect (void *op_cls, struct GNUNET_TESTBED_Peer *peer, | |||
263 | { | 263 | { |
264 | struct ServiceConnectData *data; | 264 | struct ServiceConnectData *data; |
265 | 265 | ||
266 | data = GNUNET_malloc (sizeof (struct ServiceConnectData)); | 266 | data = GNUNET_new (struct ServiceConnectData); |
267 | data->ca = ca; | 267 | data->ca = ca; |
268 | data->da = da; | 268 | data->da = da; |
269 | data->cada_cls = cada_cls; | 269 | data->cada_cls = cada_cls; |
diff --git a/src/testbed/testbed_api_statistics.c b/src/testbed/testbed_api_statistics.c index 5fa0750e3..e6efc1fb0 100644 --- a/src/testbed/testbed_api_statistics.c +++ b/src/testbed/testbed_api_statistics.c | |||
@@ -340,7 +340,7 @@ opstart_get_stats (void *cls) | |||
340 | GNUNET_break (0); | 340 | GNUNET_break (0); |
341 | continue; | 341 | continue; |
342 | } | 342 | } |
343 | peer_sc = GNUNET_malloc (sizeof (struct PeerGetStatsContext)); | 343 | peer_sc = GNUNET_new (struct PeerGetStatsContext); |
344 | peer_sc->sc = sc; | 344 | peer_sc->sc = sc; |
345 | peer_sc->peer_index = peer; | 345 | peer_sc->peer_index = peer; |
346 | sc->ops[peer] = | 346 | sc->ops[peer] = |
@@ -417,7 +417,7 @@ GNUNET_TESTBED_get_statistics (unsigned int num_peers, | |||
417 | if (NULL == no_wait_queue) | 417 | if (NULL == no_wait_queue) |
418 | no_wait_queue = GNUNET_TESTBED_operation_queue_create_ | 418 | no_wait_queue = GNUNET_TESTBED_operation_queue_create_ |
419 | (OPERATION_QUEUE_TYPE_FIXED, UINT_MAX); | 419 | (OPERATION_QUEUE_TYPE_FIXED, UINT_MAX); |
420 | sc = GNUNET_malloc (sizeof (struct GetStatsContext)); | 420 | sc = GNUNET_new (struct GetStatsContext); |
421 | sc->peers = peers; | 421 | sc->peers = peers; |
422 | sc->subsystem = (NULL == subsystem) ? NULL : GNUNET_strdup (subsystem); | 422 | sc->subsystem = (NULL == subsystem) ? NULL : GNUNET_strdup (subsystem); |
423 | sc->name = (NULL == name) ? NULL : GNUNET_strdup (name); | 423 | sc->name = (NULL == name) ? NULL : GNUNET_strdup (name); |
diff --git a/src/testbed/testbed_api_testbed.c b/src/testbed/testbed_api_testbed.c index 0bad02a7f..cbfc4812d 100644 --- a/src/testbed/testbed_api_testbed.c +++ b/src/testbed/testbed_api_testbed.c | |||
@@ -592,7 +592,7 @@ wait_op_completion (void *cls) | |||
592 | if (NULL == rc->peers) | 592 | if (NULL == rc->peers) |
593 | goto cleanup_; | 593 | goto cleanup_; |
594 | rc->shutdown = GNUNET_YES; | 594 | rc->shutdown = GNUNET_YES; |
595 | rcop = GNUNET_malloc (sizeof (struct RunContextOperation)); | 595 | rcop = GNUNET_new (struct RunContextOperation); |
596 | rcop->rc = rc; | 596 | rcop->rc = rc; |
597 | rcop->op = GNUNET_TESTBED_shutdown_peers (rc->c, rcop, NULL, NULL); | 597 | rcop->op = GNUNET_TESTBED_shutdown_peers (rc->c, rcop, NULL, NULL); |
598 | GNUNET_assert (NULL != rcop->op); | 598 | GNUNET_assert (NULL != rcop->op); |
@@ -673,7 +673,7 @@ start_peers_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
673 | rc->pstart_time = GNUNET_TIME_absolute_get (); | 673 | rc->pstart_time = GNUNET_TIME_absolute_get (); |
674 | for (peer = 0; peer < rc->num_peers; peer++) | 674 | for (peer = 0; peer < rc->num_peers; peer++) |
675 | { | 675 | { |
676 | rcop = GNUNET_malloc (sizeof (struct RunContextOperation)); | 676 | rcop = GNUNET_new (struct RunContextOperation); |
677 | rcop->rc = rc; | 677 | rcop->rc = rc; |
678 | rcop->op = GNUNET_TESTBED_peer_start (NULL, rc->peers[peer], NULL, NULL); | 678 | rcop->op = GNUNET_TESTBED_peer_start (NULL, rc->peers[peer], NULL, NULL); |
679 | GNUNET_assert (NULL != rcop->op); | 679 | GNUNET_assert (NULL != rcop->op); |
@@ -782,7 +782,7 @@ create_peers (struct GNUNET_TESTBED_RunHandle *rc) | |||
782 | rc->peer_count = 0; | 782 | rc->peer_count = 0; |
783 | for (peer = 0; peer < rc->num_peers; peer++) | 783 | for (peer = 0; peer < rc->num_peers; peer++) |
784 | { | 784 | { |
785 | rcop = GNUNET_malloc (sizeof (struct RunContextOperation)); | 785 | rcop = GNUNET_new (struct RunContextOperation); |
786 | rcop->rc = rc; | 786 | rcop->rc = rc; |
787 | rcop->op = | 787 | rcop->op = |
788 | GNUNET_TESTBED_peer_create (rc->c, | 788 | GNUNET_TESTBED_peer_create (rc->c, |
@@ -1014,7 +1014,7 @@ register_hosts (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1014 | /* Start slaves */ | 1014 | /* Start slaves */ |
1015 | for (slave = 0; slave < rc->num_hosts; slave++) | 1015 | for (slave = 0; slave < rc->num_hosts; slave++) |
1016 | { | 1016 | { |
1017 | rcop = GNUNET_malloc (sizeof (struct RunContextOperation)); | 1017 | rcop = GNUNET_new (struct RunContextOperation); |
1018 | rcop->rc = rc; | 1018 | rcop->rc = rc; |
1019 | rcop->op = | 1019 | rcop->op = |
1020 | GNUNET_TESTBED_controller_link (rcop, rc->c, rc->hosts[slave], | 1020 | GNUNET_TESTBED_controller_link (rcop, rc->c, rc->hosts[slave], |
@@ -1253,7 +1253,7 @@ GNUNET_TESTBED_run (const char *host_filename, | |||
1253 | unsigned int nhost; | 1253 | unsigned int nhost; |
1254 | 1254 | ||
1255 | GNUNET_assert (num_peers > 0); | 1255 | GNUNET_assert (num_peers > 0); |
1256 | rc = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_RunHandle)); | 1256 | rc = GNUNET_new (struct GNUNET_TESTBED_RunHandle); |
1257 | rc->cfg = GNUNET_CONFIGURATION_dup (cfg); | 1257 | rc->cfg = GNUNET_CONFIGURATION_dup (cfg); |
1258 | #if ENABLE_SUPERMUC | 1258 | #if ENABLE_SUPERMUC |
1259 | rc->num_hosts = GNUNET_TESTBED_hosts_load_from_loadleveler (rc->cfg, | 1259 | rc->num_hosts = GNUNET_TESTBED_hosts_load_from_loadleveler (rc->cfg, |
diff --git a/src/testbed/testbed_api_topology.c b/src/testbed/testbed_api_topology.c index 8d8883c96..d4eaec0c5 100644 --- a/src/testbed/testbed_api_topology.c +++ b/src/testbed/testbed_api_topology.c | |||
@@ -275,7 +275,7 @@ overlay_link_completed (void *cls, struct GNUNET_TESTBED_Operation *op, | |||
275 | { | 275 | { |
276 | LOG (GNUNET_ERROR_TYPE_WARNING, | 276 | LOG (GNUNET_ERROR_TYPE_WARNING, |
277 | "Error while establishing a link: %s -- Retrying\n", emsg); | 277 | "Error while establishing a link: %s -- Retrying\n", emsg); |
278 | retry_entry = GNUNET_malloc (sizeof (struct RetryListEntry)); | 278 | retry_entry = GNUNET_new (struct RetryListEntry); |
279 | retry_entry->link = link; | 279 | retry_entry->link = link; |
280 | GNUNET_CONTAINER_DLL_insert_tail (tc->rl_head, tc->rl_tail, retry_entry); | 280 | GNUNET_CONTAINER_DLL_insert_tail (tc->rl_head, tc->rl_tail, retry_entry); |
281 | } | 281 | } |
@@ -923,7 +923,7 @@ GNUNET_TESTBED_overlay_configure_topology_va (void *op_cls, | |||
923 | if (num_peers < 2) | 923 | if (num_peers < 2) |
924 | return NULL; | 924 | return NULL; |
925 | c = peers[0]->controller; | 925 | c = peers[0]->controller; |
926 | tc = GNUNET_malloc (sizeof (struct TopologyContext)); | 926 | tc = GNUNET_new (struct TopologyContext); |
927 | tc->peers = peers; | 927 | tc->peers = peers; |
928 | tc->num_peers = num_peers; | 928 | tc->num_peers = num_peers; |
929 | tc->op_cls = op_cls; | 929 | tc->op_cls = op_cls; |
diff --git a/src/testbed/testbed_logger_api.c b/src/testbed/testbed_logger_api.c index 562902218..399e26a2f 100644 --- a/src/testbed/testbed_logger_api.c +++ b/src/testbed/testbed_logger_api.c | |||
@@ -277,7 +277,7 @@ queue_message (struct GNUNET_TESTBED_LOGGER_Handle *h, | |||
277 | 277 | ||
278 | type = ntohs (msg->type); | 278 | type = ntohs (msg->type); |
279 | size = ntohs (msg->size); | 279 | size = ntohs (msg->size); |
280 | mq = GNUNET_malloc (sizeof (struct MessageQueue)); | 280 | mq = GNUNET_new (struct MessageQueue); |
281 | mq->msg = msg; | 281 | mq->msg = msg; |
282 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 282 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
283 | "Queueing message of type %u, size %u for sending\n", type, | 283 | "Queueing message of type %u, size %u for sending\n", type, |
@@ -333,7 +333,7 @@ GNUNET_TESTBED_LOGGER_connect (const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
333 | client = GNUNET_CLIENT_connect ("testbed-logger", cfg); | 333 | client = GNUNET_CLIENT_connect ("testbed-logger", cfg); |
334 | if (NULL == client) | 334 | if (NULL == client) |
335 | return NULL; | 335 | return NULL; |
336 | h = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_LOGGER_Handle)); | 336 | h = GNUNET_new (struct GNUNET_TESTBED_LOGGER_Handle); |
337 | h->client = client; | 337 | h->client = client; |
338 | return h; | 338 | return h; |
339 | } | 339 | } |