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/testing | |
parent | 92fd84dc7ef98452f848a62677c61a2b80b5835e (diff) |
malloc -> new
Diffstat (limited to 'src/testing')
-rw-r--r-- | src/testing/test_testing_peerstartup.c | 2 | ||||
-rw-r--r-- | src/testing/test_testing_peerstartup2.c | 2 | ||||
-rw-r--r-- | src/testing/test_testing_sharedservices.c | 2 | ||||
-rw-r--r-- | src/testing/testing.c | 8 |
4 files changed, 7 insertions, 7 deletions
diff --git a/src/testing/test_testing_peerstartup.c b/src/testing/test_testing_peerstartup.c index b871ed1e30..e025b4138c 100644 --- a/src/testing/test_testing_peerstartup.c +++ b/src/testing/test_testing_peerstartup.c @@ -95,7 +95,7 @@ run (void *cls, char *const *args, const char *cfgfile, char *emsg; struct GNUNET_PeerIdentity id; - test_ctx = GNUNET_malloc (sizeof (struct TestingContext)); + test_ctx = GNUNET_new (struct TestingContext); test_ctx->system = GNUNET_TESTING_system_create ("test-gnunet-testing", "127.0.0.1", NULL, NULL); diff --git a/src/testing/test_testing_peerstartup2.c b/src/testing/test_testing_peerstartup2.c index a4bdd4d65d..2bdae72ebe 100644 --- a/src/testing/test_testing_peerstartup2.c +++ b/src/testing/test_testing_peerstartup2.c @@ -164,7 +164,7 @@ run (void *cls, char *const *args, const char *cfgfile, char *emsg; struct GNUNET_PeerIdentity id; - test_ctx = GNUNET_malloc (sizeof (struct TestingContext)); + test_ctx = GNUNET_new (struct TestingContext); test_ctx->system = GNUNET_TESTING_system_create ("test-gnunet-testing", "127.0.0.1", NULL, NULL); diff --git a/src/testing/test_testing_sharedservices.c b/src/testing/test_testing_sharedservices.c index 5b5bc0a244..e2f956e623 100644 --- a/src/testing/test_testing_sharedservices.c +++ b/src/testing/test_testing_sharedservices.c @@ -107,7 +107,7 @@ run (void *cls, char *const *args, const char *cfgfile, struct GNUNET_TESTING_Peer *peer; unsigned int cnt; - test_ctx = GNUNET_malloc (sizeof (struct TestingContext)); + test_ctx = GNUNET_new (struct TestingContext); test_ctx->system = GNUNET_TESTING_system_create ("test-gnunet-testing", "127.0.0.1", NULL, ss); diff --git a/src/testing/testing.c b/src/testing/testing.c index f414032a07..5cb8235753 100644 --- a/src/testing/testing.c +++ b/src/testing/testing.c @@ -387,7 +387,7 @@ GNUNET_TESTING_system_create_with_portrange (const char *testdir, unsigned int cnt; GNUNET_assert (NULL != testdir); - system = GNUNET_malloc (sizeof (struct GNUNET_TESTING_System)); + system = GNUNET_new (struct GNUNET_TESTING_System); if (NULL == (system->tmppath = getenv (GNUNET_TESTING_PREFIX))) system->tmppath = GNUNET_DISK_mkdtemp (testdir); else @@ -413,7 +413,7 @@ GNUNET_TESTING_system_create_with_portrange (const char *testdir, for (cnt = 0; NULL != shared_services[cnt].service; cnt++) { tss = shared_services[cnt]; - ss = GNUNET_malloc (sizeof (struct SharedService)); + ss = GNUNET_new (struct SharedService); ss->sname = GNUNET_strdup (tss.service); ss->cfg = GNUNET_CONFIGURATION_create (); GNUNET_CONFIGURATION_iterate_section_values (tss.cfg, ss->sname, @@ -1242,7 +1242,7 @@ GNUNET_TESTING_peer_configure (struct GNUNET_TESTING_System *system, GNUNET_free (config_filename); goto err_ret; } - peer = GNUNET_malloc (sizeof (struct GNUNET_TESTING_Peer)); + peer = GNUNET_new (struct GNUNET_TESTING_Peer); peer->ss_instances = ss_instances; peer->cfgfile = config_filename; /* Free in peer_destroy */ peer->cfg = GNUNET_CONFIGURATION_dup (cfg); @@ -1291,7 +1291,7 @@ GNUNET_TESTING_peer_get_identity (struct GNUNET_TESTING_Peer *peer, memcpy (id, peer->id, sizeof (struct GNUNET_PeerIdentity)); return; } - peer->id = GNUNET_malloc (sizeof (struct GNUNET_PeerIdentity)); + peer->id = GNUNET_new (struct GNUNET_PeerIdentity); GNUNET_free (GNUNET_TESTING_hostkey_get (peer->system, peer->key_number, peer->id)); |