summaryrefslogtreecommitdiff
path: root/src/dht
diff options
context:
space:
mode:
Diffstat (limited to 'src/dht')
-rw-r--r--src/dht/dht_test_lib.c2
-rw-r--r--src/dht/gnunet-service-dht_clients.c4
-rw-r--r--src/dht/gnunet-service-dht_neighbours.c2
-rw-r--r--src/dht/gnunet-service-xdht_clients.c4
-rw-r--r--src/dht/gnunet-service-xdht_neighbours.c2
-rw-r--r--src/dht/plugin_block_dht.c2
-rw-r--r--src/dht/test_dht_monitor.c2
-rw-r--r--src/dht/test_dht_topo.c2
8 files changed, 10 insertions, 10 deletions
diff --git a/src/dht/dht_test_lib.c b/src/dht/dht_test_lib.c
index 9864da949..92b10e815 100644
--- a/src/dht/dht_test_lib.c
+++ b/src/dht/dht_test_lib.c
@@ -201,7 +201,7 @@ GNUNET_DHT_TEST_run (const char *testname,
{
struct GNUNET_DHT_TEST_Context *ctx;
- ctx = GNUNET_malloc (sizeof (struct GNUNET_DHT_TEST_Context));
+ ctx = GNUNET_new (struct GNUNET_DHT_TEST_Context);
ctx->num_peers = num_peers;
ctx->ops = GNUNET_malloc (num_peers * sizeof (struct GNUNET_TESTBED_Operation *));
ctx->dhts = GNUNET_malloc (num_peers * sizeof (struct GNUNET_DHT_Handle *));
diff --git a/src/dht/gnunet-service-dht_clients.c b/src/dht/gnunet-service-dht_clients.c
index f91311cf3..c6e72cf44 100644
--- a/src/dht/gnunet-service-dht_clients.c
+++ b/src/dht/gnunet-service-dht_clients.c
@@ -822,7 +822,7 @@ handle_dht_local_monitor (void *cls, struct GNUNET_SERVER_Client *client,
const struct GNUNET_DHT_MonitorStartStopMessage *msg;
msg = (struct GNUNET_DHT_MonitorStartStopMessage *) message;
- r = GNUNET_malloc (sizeof(struct ClientMonitorRecord));
+ r = GNUNET_new (struct ClientMonitorRecord);
r->client = find_active_client(client);
r->type = ntohl(msg->type);
@@ -833,7 +833,7 @@ handle_dht_local_monitor (void *cls, struct GNUNET_SERVER_Client *client,
r->key = NULL;
else
{
- r->key = GNUNET_malloc (sizeof (struct GNUNET_HashCode));
+ r->key = GNUNET_new (struct GNUNET_HashCode);
memcpy (r->key, &msg->key, sizeof (struct GNUNET_HashCode));
}
GNUNET_CONTAINER_DLL_insert (monitor_head, monitor_tail, r);
diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c
index 1d7eb560c..d89f26685 100644
--- a/src/dht/gnunet-service-dht_neighbours.c
+++ b/src/dht/gnunet-service-dht_neighbours.c
@@ -666,7 +666,7 @@ handle_core_connect (void *cls, const struct GNUNET_PeerIdentity *peer)
&phash);
peer_bucket = find_bucket (&phash);
GNUNET_assert ((peer_bucket >= 0) && (peer_bucket < MAX_BUCKETS));
- ret = GNUNET_malloc (sizeof (struct PeerInfo));
+ ret = GNUNET_new (struct PeerInfo);
#if 0
ret->latency = latency;
ret->distance = distance;
diff --git a/src/dht/gnunet-service-xdht_clients.c b/src/dht/gnunet-service-xdht_clients.c
index 2bcd145a1..9cc156e3d 100644
--- a/src/dht/gnunet-service-xdht_clients.c
+++ b/src/dht/gnunet-service-xdht_clients.c
@@ -822,7 +822,7 @@ handle_dht_local_monitor (void *cls, struct GNUNET_SERVER_Client *client,
const struct GNUNET_DHT_MonitorStartStopMessage *msg;
msg = (struct GNUNET_DHT_MonitorStartStopMessage *) message;
- r = GNUNET_malloc (sizeof(struct ClientMonitorRecord));
+ r = GNUNET_new (struct ClientMonitorRecord);
r->client = find_active_client(client);
r->type = ntohl(msg->type);
@@ -833,7 +833,7 @@ handle_dht_local_monitor (void *cls, struct GNUNET_SERVER_Client *client,
r->key = NULL;
else
{
- r->key = GNUNET_malloc (sizeof (struct GNUNET_HashCode));
+ r->key = GNUNET_new (struct GNUNET_HashCode);
memcpy (r->key, &msg->key, sizeof (struct GNUNET_HashCode));
}
GNUNET_CONTAINER_DLL_insert (monitor_head, monitor_tail, r);
diff --git a/src/dht/gnunet-service-xdht_neighbours.c b/src/dht/gnunet-service-xdht_neighbours.c
index af7ef1612..8f47feef5 100644
--- a/src/dht/gnunet-service-xdht_neighbours.c
+++ b/src/dht/gnunet-service-xdht_neighbours.c
@@ -666,7 +666,7 @@ handle_core_connect (void *cls, const struct GNUNET_PeerIdentity *peer)
&phash);
peer_bucket = find_bucket (&phash);
GNUNET_assert ((peer_bucket >= 0) && (peer_bucket < MAX_BUCKETS));
- ret = GNUNET_malloc (sizeof (struct PeerInfo));
+ ret = GNUNET_new (struct PeerInfo);
#if 0
ret->latency = latency;
ret->distance = distance;
diff --git a/src/dht/plugin_block_dht.c b/src/dht/plugin_block_dht.c
index a21167fb0..d6798f18c 100644
--- a/src/dht/plugin_block_dht.c
+++ b/src/dht/plugin_block_dht.c
@@ -172,7 +172,7 @@ libgnunet_plugin_block_dht_init (void *cls)
};
struct GNUNET_BLOCK_PluginFunctions *api;
- api = GNUNET_malloc (sizeof (struct GNUNET_BLOCK_PluginFunctions));
+ api = GNUNET_new (struct GNUNET_BLOCK_PluginFunctions);
api->evaluate = &block_plugin_dht_evaluate;
api->get_key = &block_plugin_dht_get_key;
api->types = types;
diff --git a/src/dht/test_dht_monitor.c b/src/dht/test_dht_monitor.c
index 303fe8f87..98791d28f 100644
--- a/src/dht/test_dht_monitor.c
+++ b/src/dht/test_dht_monitor.c
@@ -380,7 +380,7 @@ run (void *cls,
GNUNET_CRYPTO_hash (&i, sizeof (i), &key);
for (j=0;j<num_peers;j++)
{
- get_op = GNUNET_malloc (sizeof (struct GetOperation));
+ get_op = GNUNET_new (struct GetOperation);
GNUNET_CONTAINER_DLL_insert (get_head,
get_tail,
get_op);
diff --git a/src/dht/test_dht_topo.c b/src/dht/test_dht_topo.c
index 1fd61129b..311bb5597 100644
--- a/src/dht/test_dht_topo.c
+++ b/src/dht/test_dht_topo.c
@@ -382,7 +382,7 @@ run (void *cls,
GNUNET_CRYPTO_hash (&i, sizeof (i), &key);
for (j=0;j<num_peers;j++)
{
- get_op = GNUNET_malloc (sizeof (struct GetOperation));
+ get_op = GNUNET_new (struct GetOperation);
GNUNET_CONTAINER_DLL_insert (get_head,
get_tail,
get_op);