aboutsummaryrefslogtreecommitdiff
path: root/src/testing/testing.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing/testing.c')
-rw-r--r--src/testing/testing.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/testing/testing.c b/src/testing/testing.c
index f414032a0..5cb823575 100644
--- a/src/testing/testing.c
+++ b/src/testing/testing.c
@@ -387,7 +387,7 @@ GNUNET_TESTING_system_create_with_portrange (const char *testdir,
387 unsigned int cnt; 387 unsigned int cnt;
388 388
389 GNUNET_assert (NULL != testdir); 389 GNUNET_assert (NULL != testdir);
390 system = GNUNET_malloc (sizeof (struct GNUNET_TESTING_System)); 390 system = GNUNET_new (struct GNUNET_TESTING_System);
391 if (NULL == (system->tmppath = getenv (GNUNET_TESTING_PREFIX))) 391 if (NULL == (system->tmppath = getenv (GNUNET_TESTING_PREFIX)))
392 system->tmppath = GNUNET_DISK_mkdtemp (testdir); 392 system->tmppath = GNUNET_DISK_mkdtemp (testdir);
393 else 393 else
@@ -413,7 +413,7 @@ GNUNET_TESTING_system_create_with_portrange (const char *testdir,
413 for (cnt = 0; NULL != shared_services[cnt].service; cnt++) 413 for (cnt = 0; NULL != shared_services[cnt].service; cnt++)
414 { 414 {
415 tss = shared_services[cnt]; 415 tss = shared_services[cnt];
416 ss = GNUNET_malloc (sizeof (struct SharedService)); 416 ss = GNUNET_new (struct SharedService);
417 ss->sname = GNUNET_strdup (tss.service); 417 ss->sname = GNUNET_strdup (tss.service);
418 ss->cfg = GNUNET_CONFIGURATION_create (); 418 ss->cfg = GNUNET_CONFIGURATION_create ();
419 GNUNET_CONFIGURATION_iterate_section_values (tss.cfg, ss->sname, 419 GNUNET_CONFIGURATION_iterate_section_values (tss.cfg, ss->sname,
@@ -1242,7 +1242,7 @@ GNUNET_TESTING_peer_configure (struct GNUNET_TESTING_System *system,
1242 GNUNET_free (config_filename); 1242 GNUNET_free (config_filename);
1243 goto err_ret; 1243 goto err_ret;
1244 } 1244 }
1245 peer = GNUNET_malloc (sizeof (struct GNUNET_TESTING_Peer)); 1245 peer = GNUNET_new (struct GNUNET_TESTING_Peer);
1246 peer->ss_instances = ss_instances; 1246 peer->ss_instances = ss_instances;
1247 peer->cfgfile = config_filename; /* Free in peer_destroy */ 1247 peer->cfgfile = config_filename; /* Free in peer_destroy */
1248 peer->cfg = GNUNET_CONFIGURATION_dup (cfg); 1248 peer->cfg = GNUNET_CONFIGURATION_dup (cfg);
@@ -1291,7 +1291,7 @@ GNUNET_TESTING_peer_get_identity (struct GNUNET_TESTING_Peer *peer,
1291 memcpy (id, peer->id, sizeof (struct GNUNET_PeerIdentity)); 1291 memcpy (id, peer->id, sizeof (struct GNUNET_PeerIdentity));
1292 return; 1292 return;
1293 } 1293 }
1294 peer->id = GNUNET_malloc (sizeof (struct GNUNET_PeerIdentity)); 1294 peer->id = GNUNET_new (struct GNUNET_PeerIdentity);
1295 GNUNET_free (GNUNET_TESTING_hostkey_get (peer->system, 1295 GNUNET_free (GNUNET_TESTING_hostkey_get (peer->system,
1296 peer->key_number, 1296 peer->key_number,
1297 peer->id)); 1297 peer->id));