diff options
Diffstat (limited to 'src')
145 files changed, 326 insertions, 326 deletions
diff --git a/src/arm/arm_api.c b/src/arm/arm_api.c index 7e6ce1870..6c0dec4a6 100644 --- a/src/arm/arm_api.c +++ b/src/arm/arm_api.c | |||
@@ -636,7 +636,7 @@ GNUNET_ARM_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
636 | { | 636 | { |
637 | struct GNUNET_ARM_Handle *h; | 637 | struct GNUNET_ARM_Handle *h; |
638 | 638 | ||
639 | h = GNUNET_malloc (sizeof (struct GNUNET_ARM_Handle)); | 639 | h = GNUNET_new (struct GNUNET_ARM_Handle); |
640 | h->cfg = GNUNET_CONFIGURATION_dup (cfg); | 640 | h->cfg = GNUNET_CONFIGURATION_dup (cfg); |
641 | h->currently_down = GNUNET_YES; | 641 | h->currently_down = GNUNET_YES; |
642 | h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; | 642 | h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; |
@@ -1067,7 +1067,7 @@ GNUNET_ARM_request_service_list (struct GNUNET_ARM_Handle *h, | |||
1067 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1067 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1068 | "Requesting LIST from ARM service with timeout: %s\n", | 1068 | "Requesting LIST from ARM service with timeout: %s\n", |
1069 | GNUNET_STRINGS_relative_time_to_string (timeout, GNUNET_YES)); | 1069 | GNUNET_STRINGS_relative_time_to_string (timeout, GNUNET_YES)); |
1070 | cm = GNUNET_malloc (sizeof (struct ARMControlMessage)); | 1070 | cm = GNUNET_new (struct ARMControlMessage); |
1071 | cm->h = h; | 1071 | cm->h = h; |
1072 | cm->list_cont = cont; | 1072 | cm->list_cont = cont; |
1073 | cm->cont_cls = cont_cls; | 1073 | cm->cont_cls = cont_cls; |
diff --git a/src/arm/arm_monitor_api.c b/src/arm/arm_monitor_api.c index 7b403fde8..676543f26 100644 --- a/src/arm/arm_monitor_api.c +++ b/src/arm/arm_monitor_api.c | |||
@@ -251,7 +251,7 @@ GNUNET_ARM_monitor (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
251 | { | 251 | { |
252 | struct GNUNET_ARM_MonitorHandle *h; | 252 | struct GNUNET_ARM_MonitorHandle *h; |
253 | 253 | ||
254 | h = GNUNET_malloc (sizeof (struct GNUNET_ARM_MonitorHandle)); | 254 | h = GNUNET_new (struct GNUNET_ARM_MonitorHandle); |
255 | h->cfg = GNUNET_CONFIGURATION_dup (cfg); | 255 | h->cfg = GNUNET_CONFIGURATION_dup (cfg); |
256 | h->currently_down = GNUNET_YES; | 256 | h->currently_down = GNUNET_YES; |
257 | h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; | 257 | h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; |
diff --git a/src/arm/test_exponential_backoff.c b/src/arm/test_exponential_backoff.c index 0561c3ea8..7a552cc7c 100644 --- a/src/arm/test_exponential_backoff.c +++ b/src/arm/test_exponential_backoff.c | |||
@@ -214,7 +214,7 @@ do_nothing_service_shutdown (struct GNUNET_CLIENT_Connection *sock, | |||
214 | { | 214 | { |
215 | struct ShutdownContext *shutdown_ctx; | 215 | struct ShutdownContext *shutdown_ctx; |
216 | 216 | ||
217 | shutdown_ctx = GNUNET_malloc (sizeof (struct ShutdownContext)); | 217 | shutdown_ctx = GNUNET_new (struct ShutdownContext); |
218 | shutdown_ctx->cont = cont; | 218 | shutdown_ctx->cont = cont; |
219 | shutdown_ctx->cont_cls = cont_cls; | 219 | shutdown_ctx->cont_cls = cont_cls; |
220 | shutdown_ctx->sock = sock; | 220 | shutdown_ctx->sock = sock; |
diff --git a/src/ats-tests/perf_ats_logging.c b/src/ats-tests/perf_ats_logging.c index 6dc5a96b4..823cfaf38 100644 --- a/src/ats-tests/perf_ats_logging.c +++ b/src/ats-tests/perf_ats_logging.c | |||
@@ -513,7 +513,7 @@ collect_log_now (void) | |||
513 | for (c_m = 0; c_m < num_peers; c_m++) | 513 | for (c_m = 0; c_m < num_peers; c_m++) |
514 | { | 514 | { |
515 | bp = &lp[c_m]; | 515 | bp = &lp[c_m]; |
516 | mlt = GNUNET_malloc (sizeof (struct PeerLoggingTimestep)); | 516 | mlt = GNUNET_new (struct PeerLoggingTimestep); |
517 | GNUNET_CONTAINER_DLL_insert_tail(bp->head, bp->tail, mlt); | 517 | GNUNET_CONTAINER_DLL_insert_tail(bp->head, bp->tail, mlt); |
518 | prev_log_mlt = mlt->prev; | 518 | prev_log_mlt = mlt->prev; |
519 | 519 | ||
diff --git a/src/ats/ats_api_performance.c b/src/ats/ats_api_performance.c index 390531d9f..90e061c1d 100644 --- a/src/ats/ats_api_performance.c +++ b/src/ats/ats_api_performance.c | |||
@@ -628,7 +628,7 @@ GNUNET_ATS_performance_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
628 | { | 628 | { |
629 | struct GNUNET_ATS_PerformanceHandle *ph; | 629 | struct GNUNET_ATS_PerformanceHandle *ph; |
630 | 630 | ||
631 | ph = GNUNET_malloc (sizeof (struct GNUNET_ATS_PerformanceHandle)); | 631 | ph = GNUNET_new (struct GNUNET_ATS_PerformanceHandle); |
632 | ph->cfg = cfg; | 632 | ph->cfg = cfg; |
633 | ph->addr_info_cb = addr_info_cb; | 633 | ph->addr_info_cb = addr_info_cb; |
634 | ph->addr_info_cb_cls = addr_info_cb_cls; | 634 | ph->addr_info_cb_cls = addr_info_cb_cls; |
@@ -703,7 +703,7 @@ GNUNET_ATS_reserve_bandwidth (struct GNUNET_ATS_PerformanceHandle *ph, | |||
703 | struct PendingMessage *p; | 703 | struct PendingMessage *p; |
704 | struct ReservationRequestMessage *m; | 704 | struct ReservationRequestMessage *m; |
705 | 705 | ||
706 | rc = GNUNET_malloc (sizeof (struct GNUNET_ATS_ReservationContext)); | 706 | rc = GNUNET_new (struct GNUNET_ATS_ReservationContext); |
707 | rc->size = amount; | 707 | rc->size = amount; |
708 | rc->peer = *peer; | 708 | rc->peer = *peer; |
709 | rc->rcb = rcb; | 709 | rc->rcb = rcb; |
@@ -763,7 +763,7 @@ GNUNET_ATS_performance_list_addresses ( | |||
763 | if (NULL == infocb) | 763 | if (NULL == infocb) |
764 | return NULL ; | 764 | return NULL ; |
765 | 765 | ||
766 | alh = GNUNET_malloc (sizeof (struct GNUNET_ATS_AddressListHandle)); | 766 | alh = GNUNET_new (struct GNUNET_ATS_AddressListHandle); |
767 | alh->id = handle->id; | 767 | alh->id = handle->id; |
768 | handle->id++; | 768 | handle->id++; |
769 | alh->cb = infocb; | 769 | alh->cb = infocb; |
diff --git a/src/ats/ats_api_scheduling.c b/src/ats/ats_api_scheduling.c index 1ef6ce095..7750ad1cf 100644 --- a/src/ats/ats_api_scheduling.c +++ b/src/ats/ats_api_scheduling.c | |||
@@ -967,7 +967,7 @@ GNUNET_ATS_scheduling_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
967 | { | 967 | { |
968 | struct GNUNET_ATS_SchedulingHandle *sh; | 968 | struct GNUNET_ATS_SchedulingHandle *sh; |
969 | 969 | ||
970 | sh = GNUNET_malloc (sizeof (struct GNUNET_ATS_SchedulingHandle)); | 970 | sh = GNUNET_new (struct GNUNET_ATS_SchedulingHandle); |
971 | sh->cfg = cfg; | 971 | sh->cfg = cfg; |
972 | sh->suggest_cb = suggest_cb; | 972 | sh->suggest_cb = suggest_cb; |
973 | sh->suggest_cb_cls = suggest_cb_cls; | 973 | sh->suggest_cb_cls = suggest_cb_cls; |
@@ -1083,7 +1083,7 @@ GNUNET_ATS_suggest_address (struct GNUNET_ATS_SchedulingHandle *sh, | |||
1083 | m->peer = *peer; | 1083 | m->peer = *peer; |
1084 | GNUNET_CONTAINER_DLL_insert_tail (sh->pending_head, sh->pending_tail, p); | 1084 | GNUNET_CONTAINER_DLL_insert_tail (sh->pending_head, sh->pending_tail, p); |
1085 | do_transmit (sh); | 1085 | do_transmit (sh); |
1086 | s = GNUNET_malloc (sizeof (struct GNUNET_ATS_SuggestHandle)); | 1086 | s = GNUNET_new (struct GNUNET_ATS_SuggestHandle); |
1087 | s->id = (*peer); | 1087 | s->id = (*peer); |
1088 | GNUNET_CONTAINER_DLL_insert_tail (sh->sug_head, sh->sug_tail, s); | 1088 | GNUNET_CONTAINER_DLL_insert_tail (sh->sug_head, sh->sug_tail, s); |
1089 | return s; | 1089 | return s; |
diff --git a/src/ats/gnunet-service-ats_addresses.c b/src/ats/gnunet-service-ats_addresses.c index ddcff962b..2cdc12766 100644 --- a/src/ats/gnunet-service-ats_addresses.c +++ b/src/ats/gnunet-service-ats_addresses.c | |||
@@ -1240,7 +1240,7 @@ GAS_addresses_request_address (struct GAS_Addresses_Handle *handle, | |||
1240 | } | 1240 | } |
1241 | if (NULL == cur) | 1241 | if (NULL == cur) |
1242 | { | 1242 | { |
1243 | cur = GNUNET_malloc (sizeof (struct GAS_Addresses_Suggestion_Requests)); | 1243 | cur = GNUNET_new (struct GAS_Addresses_Suggestion_Requests); |
1244 | cur->id = (*peer); | 1244 | cur->id = (*peer); |
1245 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | 1245 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, |
1246 | "Adding new address suggestion request for `%s'\n", | 1246 | "Adding new address suggestion request for `%s'\n", |
@@ -1836,7 +1836,7 @@ GAS_addresses_preference_change (struct GAS_Addresses_Handle *handle, | |||
1836 | 1836 | ||
1837 | if (NULL == find_preference_client (handle, client)) | 1837 | if (NULL == find_preference_client (handle, client)) |
1838 | { | 1838 | { |
1839 | pc = GNUNET_malloc (sizeof (struct GAS_Addresses_Preference_Clients)); | 1839 | pc = GNUNET_new (struct GAS_Addresses_Preference_Clients); |
1840 | pc->client = client; | 1840 | pc->client = client; |
1841 | GNUNET_CONTAINER_DLL_insert (handle->preference_clients_head, | 1841 | GNUNET_CONTAINER_DLL_insert (handle->preference_clients_head, |
1842 | handle->preference_clients_tail, pc); | 1842 | handle->preference_clients_tail, pc); |
@@ -2091,7 +2091,7 @@ GAS_addresses_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
2091 | char *plugin_short; | 2091 | char *plugin_short; |
2092 | int c; | 2092 | int c; |
2093 | 2093 | ||
2094 | ah = GNUNET_malloc (sizeof (struct GAS_Addresses_Handle)); | 2094 | ah = GNUNET_new (struct GAS_Addresses_Handle); |
2095 | ah->running = GNUNET_NO; | 2095 | ah->running = GNUNET_NO; |
2096 | 2096 | ||
2097 | ah->stat = (struct GNUNET_STATISTICS_Handle *) stats; | 2097 | ah->stat = (struct GNUNET_STATISTICS_Handle *) stats; |
diff --git a/src/ats/gnunet-service-ats_normalization.c b/src/ats/gnunet-service-ats_normalization.c index 67fd32066..d75ebf42d 100644 --- a/src/ats/gnunet-service-ats_normalization.c +++ b/src/ats/gnunet-service-ats_normalization.c | |||
@@ -445,7 +445,7 @@ GAS_normalization_normalize_preference (void *src, | |||
445 | /* Not found: create new preference client */ | 445 | /* Not found: create new preference client */ |
446 | if (NULL == c_cur) | 446 | if (NULL == c_cur) |
447 | { | 447 | { |
448 | c_cur = GNUNET_malloc (sizeof (struct PreferenceClient)); | 448 | c_cur = GNUNET_new (struct PreferenceClient); |
449 | c_cur->client = src; | 449 | c_cur->client = src; |
450 | GNUNET_CONTAINER_DLL_insert(pc_head, pc_tail, c_cur); | 450 | GNUNET_CONTAINER_DLL_insert(pc_head, pc_tail, c_cur); |
451 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Adding new client %p \n", c_cur); | 451 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Adding new client %p \n", c_cur); |
@@ -459,7 +459,7 @@ GAS_normalization_normalize_preference (void *src, | |||
459 | /* Not found: create new peer entry */ | 459 | /* Not found: create new peer entry */ |
460 | if (NULL == p_cur) | 460 | if (NULL == p_cur) |
461 | { | 461 | { |
462 | p_cur = GNUNET_malloc (sizeof (struct PreferencePeer)); | 462 | p_cur = GNUNET_new (struct PreferencePeer); |
463 | p_cur->client = c_cur; | 463 | p_cur->client = c_cur; |
464 | p_cur->id = (*peer); | 464 | p_cur->id = (*peer); |
465 | for (i = 0; i < GNUNET_ATS_PreferenceCount; i++) | 465 | for (i = 0; i < GNUNET_ATS_PreferenceCount; i++) |
diff --git a/src/ats/gnunet-service-ats_performance.c b/src/ats/gnunet-service-ats_performance.c index 8aad96eea..b9d918103 100644 --- a/src/ats/gnunet-service-ats_performance.c +++ b/src/ats/gnunet-service-ats_performance.c | |||
@@ -307,7 +307,7 @@ GAS_performance_add_client (struct GNUNET_SERVER_Client *client, | |||
307 | struct PerformanceClient *pc; | 307 | struct PerformanceClient *pc; |
308 | GNUNET_break (NULL == find_client (client)); | 308 | GNUNET_break (NULL == find_client (client)); |
309 | 309 | ||
310 | pc = GNUNET_malloc (sizeof (struct PerformanceClient)); | 310 | pc = GNUNET_new (struct PerformanceClient); |
311 | pc->client = client; | 311 | pc->client = client; |
312 | pc->flag = flag; | 312 | pc->flag = flag; |
313 | 313 | ||
diff --git a/src/ats/perf_ats_solver.c b/src/ats/perf_ats_solver.c index 0cfc72c69..89d0d82e2 100644 --- a/src/ats/perf_ats_solver.c +++ b/src/ats/perf_ats_solver.c | |||
@@ -456,7 +456,7 @@ solver_info_cb (void *cls, | |||
456 | if ((GAS_STAT_SUCCESS == stat) && (NULL == ph.current_result)) | 456 | if ((GAS_STAT_SUCCESS == stat) && (NULL == ph.current_result)) |
457 | { | 457 | { |
458 | /* Create new result */ | 458 | /* Create new result */ |
459 | tmp = GNUNET_malloc (sizeof (struct Result)); | 459 | tmp = GNUNET_new (struct Result); |
460 | ph.current_result = tmp; | 460 | ph.current_result = tmp; |
461 | GNUNET_CONTAINER_DLL_insert_tail(ph.head, ph.tail, tmp); | 461 | GNUNET_CONTAINER_DLL_insert_tail(ph.head, ph.tail, tmp); |
462 | ph.current_result->addresses = ph.current_a; | 462 | ph.current_result->addresses = ph.current_a; |
diff --git a/src/ats/plugin_ats_mlp.c b/src/ats/plugin_ats_mlp.c index 0e6f60893..7dd31edf5 100644 --- a/src/ats/plugin_ats_mlp.c +++ b/src/ats/plugin_ats_mlp.c | |||
@@ -1672,7 +1672,7 @@ GAS_mlp_get_preferred_address (void *solver, | |||
1672 | LOG (GNUNET_ERROR_TYPE_INFO, "Adding peer `%s' to list of requested_peers with requests\n", | 1672 | LOG (GNUNET_ERROR_TYPE_INFO, "Adding peer `%s' to list of requested_peers with requests\n", |
1673 | GNUNET_i2s (peer)); | 1673 | GNUNET_i2s (peer)); |
1674 | 1674 | ||
1675 | p = GNUNET_malloc (sizeof (struct ATS_Peer)); | 1675 | p = GNUNET_new (struct ATS_Peer); |
1676 | p->id = (*peer); | 1676 | p->id = (*peer); |
1677 | p->f = get_peer_pref_value (mlp, peer); | 1677 | p->f = get_peer_pref_value (mlp, peer); |
1678 | GNUNET_CONTAINER_multipeermap_put (mlp->requested_peers, | 1678 | GNUNET_CONTAINER_multipeermap_put (mlp->requested_peers, |
@@ -1887,7 +1887,7 @@ void * | |||
1887 | libgnunet_plugin_ats_mlp_init (void *cls) | 1887 | libgnunet_plugin_ats_mlp_init (void *cls) |
1888 | { | 1888 | { |
1889 | struct GNUNET_ATS_PluginEnvironment *env = cls; | 1889 | struct GNUNET_ATS_PluginEnvironment *env = cls; |
1890 | struct GAS_MLP_Handle * mlp = GNUNET_malloc (sizeof (struct GAS_MLP_Handle)); | 1890 | struct GAS_MLP_Handle * mlp = GNUNET_new (struct GAS_MLP_Handle); |
1891 | 1891 | ||
1892 | double D; | 1892 | double D; |
1893 | double R; | 1893 | double R; |
diff --git a/src/ats/plugin_ats_proportional.c b/src/ats/plugin_ats_proportional.c index 82a41d39f..62f571e5b 100644 --- a/src/ats/plugin_ats_proportional.c +++ b/src/ats/plugin_ats_proportional.c | |||
@@ -409,7 +409,7 @@ libgnunet_plugin_ats_proportional_init (void *cls) | |||
409 | GNUNET_assert(NULL != env->get_preferences); | 409 | GNUNET_assert(NULL != env->get_preferences); |
410 | GNUNET_assert(NULL != env->get_property); | 410 | GNUNET_assert(NULL != env->get_property); |
411 | 411 | ||
412 | s = GNUNET_malloc (sizeof (struct GAS_PROPORTIONAL_Handle)); | 412 | s = GNUNET_new (struct GAS_PROPORTIONAL_Handle); |
413 | s->env = env; | 413 | s->env = env; |
414 | env->sf.s_add = &GAS_proportional_address_add; | 414 | env->sf.s_add = &GAS_proportional_address_add; |
415 | env->sf.s_address_update_property = &GAS_proportional_address_property_changed; | 415 | env->sf.s_address_update_property = &GAS_proportional_address_property_changed; |
@@ -1572,12 +1572,12 @@ GAS_proportional_address_add (void *solver, struct ATS_Address *address, | |||
1572 | return; | 1572 | return; |
1573 | } | 1573 | } |
1574 | 1574 | ||
1575 | aw = GNUNET_malloc (sizeof (struct AddressWrapper)); | 1575 | aw = GNUNET_new (struct AddressWrapper); |
1576 | aw->addr = address; | 1576 | aw->addr = address; |
1577 | GNUNET_CONTAINER_DLL_insert(net->head, net->tail, aw); | 1577 | GNUNET_CONTAINER_DLL_insert(net->head, net->tail, aw); |
1578 | addresse_increment (s, net, GNUNET_YES, GNUNET_NO); | 1578 | addresse_increment (s, net, GNUNET_YES, GNUNET_NO); |
1579 | 1579 | ||
1580 | asi = GNUNET_malloc (sizeof (struct AddressSolverInformation)); | 1580 | asi = GNUNET_new (struct AddressSolverInformation); |
1581 | asi->network = net; | 1581 | asi->network = net; |
1582 | asi->calculated_quota_in_NBO = 0; | 1582 | asi->calculated_quota_in_NBO = 0; |
1583 | asi->calculated_quota_out_NBO = 0; | 1583 | asi->calculated_quota_out_NBO = 0; |
diff --git a/src/ats/plugin_ats_ril.c b/src/ats/plugin_ats_ril.c index db6ce5411..a918baa2b 100755 --- a/src/ats/plugin_ats_ril.c +++ b/src/ats/plugin_ats_ril.c | |||
@@ -1624,7 +1624,7 @@ agent_init (void *s, const struct GNUNET_PeerIdentity *peer) | |||
1624 | { | 1624 | { |
1625 | int i; | 1625 | int i; |
1626 | struct GAS_RIL_Handle * solver = s; | 1626 | struct GAS_RIL_Handle * solver = s; |
1627 | struct RIL_Peer_Agent * agent = GNUNET_malloc (sizeof (struct RIL_Peer_Agent)); | 1627 | struct RIL_Peer_Agent * agent = GNUNET_new (struct RIL_Peer_Agent); |
1628 | 1628 | ||
1629 | agent->envi = solver; | 1629 | agent->envi = solver; |
1630 | agent->peer = *peer; | 1630 | agent->peer = *peer; |
@@ -2045,7 +2045,7 @@ GAS_ril_address_add (void *solver, struct ATS_Address *address, uint32_t network | |||
2045 | agent = ril_get_agent (s, &address->peer, GNUNET_YES); | 2045 | agent = ril_get_agent (s, &address->peer, GNUNET_YES); |
2046 | 2046 | ||
2047 | //add address | 2047 | //add address |
2048 | address_wrapped = GNUNET_malloc (sizeof (struct RIL_Address_Wrapped)); | 2048 | address_wrapped = GNUNET_new (struct RIL_Address_Wrapped); |
2049 | address_wrapped->address_naked = address; | 2049 | address_wrapped->address_naked = address; |
2050 | GNUNET_CONTAINER_DLL_insert_tail(agent->addresses_head, agent->addresses_tail, address_wrapped); | 2050 | GNUNET_CONTAINER_DLL_insert_tail(agent->addresses_head, agent->addresses_tail, address_wrapped); |
2051 | 2051 | ||
diff --git a/src/ats/test_ats_api_bandwidth_consumption.c b/src/ats/test_ats_api_bandwidth_consumption.c index 74ee22cfb..493323657 100644 --- a/src/ats/test_ats_api_bandwidth_consumption.c +++ b/src/ats/test_ats_api_bandwidth_consumption.c | |||
@@ -189,8 +189,8 @@ run (void *cls, | |||
189 | end (); | 189 | end (); |
190 | return; | 190 | return; |
191 | } | 191 | } |
192 | p = GNUNET_malloc (sizeof (struct PeerContext)); | 192 | p = GNUNET_new (struct PeerContext); |
193 | addr = GNUNET_malloc (sizeof (struct Address)); | 193 | addr = GNUNET_new (struct Address); |
194 | 194 | ||
195 | atp = GNUNET_ATS_performance_init (cfg, &performance_cb, NULL); | 195 | atp = GNUNET_ATS_performance_init (cfg, &performance_cb, NULL); |
196 | if (atp == NULL) | 196 | if (atp == NULL) |
diff --git a/src/block/plugin_block_template.c b/src/block/plugin_block_template.c index 7c62de6b1..18809b1b1 100644 --- a/src/block/plugin_block_template.c +++ b/src/block/plugin_block_template.c | |||
@@ -111,7 +111,7 @@ libgnunet_plugin_block_template_init (void *cls) | |||
111 | }; | 111 | }; |
112 | struct GNUNET_BLOCK_PluginFunctions *api; | 112 | struct GNUNET_BLOCK_PluginFunctions *api; |
113 | 113 | ||
114 | api = GNUNET_malloc (sizeof (struct GNUNET_BLOCK_PluginFunctions)); | 114 | api = GNUNET_new (struct GNUNET_BLOCK_PluginFunctions); |
115 | api->evaluate = &block_plugin_template_evaluate; | 115 | api->evaluate = &block_plugin_template_evaluate; |
116 | api->get_key = &block_plugin_template_get_key; | 116 | api->get_key = &block_plugin_template_get_key; |
117 | api->types = types; | 117 | api->types = types; |
diff --git a/src/consensus/consensus_api.c b/src/consensus/consensus_api.c index d8e65c52f..0a2a7d7ac 100644 --- a/src/consensus/consensus_api.c +++ b/src/consensus/consensus_api.c | |||
@@ -180,7 +180,7 @@ GNUNET_CONSENSUS_create (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
180 | GNUNET_MQ_HANDLERS_END | 180 | GNUNET_MQ_HANDLERS_END |
181 | }; | 181 | }; |
182 | 182 | ||
183 | consensus = GNUNET_malloc (sizeof (struct GNUNET_CONSENSUS_Handle)); | 183 | consensus = GNUNET_new (struct GNUNET_CONSENSUS_Handle); |
184 | consensus->cfg = cfg; | 184 | consensus->cfg = cfg; |
185 | consensus->new_element_cb = new_element_cb; | 185 | consensus->new_element_cb = new_element_cb; |
186 | consensus->new_element_cls = new_element_cls; | 186 | consensus->new_element_cls = new_element_cls; |
diff --git a/src/core/gnunet-service-core_clients.c b/src/core/gnunet-service-core_clients.c index 5f745e3bc..f6574b7f9 100644 --- a/src/core/gnunet-service-core_clients.c +++ b/src/core/gnunet-service-core_clients.c | |||
@@ -377,7 +377,7 @@ handle_client_send_request (void *cls, struct GNUNET_SERVER_Client *client, | |||
377 | if (car == NULL) | 377 | if (car == NULL) |
378 | { | 378 | { |
379 | /* create new entry */ | 379 | /* create new entry */ |
380 | car = GNUNET_malloc (sizeof (struct GSC_ClientActiveRequest)); | 380 | car = GNUNET_new (struct GSC_ClientActiveRequest); |
381 | GNUNET_assert (GNUNET_OK == | 381 | GNUNET_assert (GNUNET_OK == |
382 | GNUNET_CONTAINER_multipeermap_put (c->requests, | 382 | GNUNET_CONTAINER_multipeermap_put (c->requests, |
383 | &req->peer, | 383 | &req->peer, |
diff --git a/src/core/gnunet-service-core_sessions.c b/src/core/gnunet-service-core_sessions.c index a8d3d3609..eb42d6fbc 100644 --- a/src/core/gnunet-service-core_sessions.c +++ b/src/core/gnunet-service-core_sessions.c | |||
@@ -265,7 +265,7 @@ GSC_SESSIONS_create (const struct GNUNET_PeerIdentity *peer, | |||
265 | 265 | ||
266 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Creating session for peer `%4s'\n", | 266 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Creating session for peer `%4s'\n", |
267 | GNUNET_i2s (peer)); | 267 | GNUNET_i2s (peer)); |
268 | session = GNUNET_malloc (sizeof (struct Session)); | 268 | session = GNUNET_new (struct Session); |
269 | session->tmap = GSC_TYPEMAP_create (); | 269 | session->tmap = GSC_TYPEMAP_create (); |
270 | session->peer = *peer; | 270 | session->peer = *peer; |
271 | session->kxinfo = kx; | 271 | session->kxinfo = kx; |
diff --git a/src/core/gnunet-service-core_typemap.c b/src/core/gnunet-service-core_typemap.c index d2dab5d99..c9774ddec 100644 --- a/src/core/gnunet-service-core_typemap.c +++ b/src/core/gnunet-service-core_typemap.c | |||
@@ -114,13 +114,13 @@ GSC_TYPEMAP_get_from_message (const struct GNUNET_MessageHeader *msg) | |||
114 | GNUNET_break_op (0); | 114 | GNUNET_break_op (0); |
115 | return NULL; | 115 | return NULL; |
116 | } | 116 | } |
117 | ret = GNUNET_malloc (sizeof (struct GSC_TypeMap)); | 117 | ret = GNUNET_new (struct GSC_TypeMap); |
118 | memcpy (ret, &msg[1], sizeof (struct GSC_TypeMap)); | 118 | memcpy (ret, &msg[1], sizeof (struct GSC_TypeMap)); |
119 | return ret; | 119 | return ret; |
120 | case GNUNET_MESSAGE_TYPE_CORE_COMPRESSED_TYPE_MAP: | 120 | case GNUNET_MESSAGE_TYPE_CORE_COMPRESSED_TYPE_MAP: |
121 | GNUNET_STATISTICS_update (GSC_stats, gettext_noop ("# type maps received"), | 121 | GNUNET_STATISTICS_update (GSC_stats, gettext_noop ("# type maps received"), |
122 | 1, GNUNET_NO); | 122 | 1, GNUNET_NO); |
123 | ret = GNUNET_malloc (sizeof (struct GSC_TypeMap)); | 123 | ret = GNUNET_new (struct GSC_TypeMap); |
124 | dlen = sizeof (struct GSC_TypeMap); | 124 | dlen = sizeof (struct GSC_TypeMap); |
125 | if ((Z_OK != | 125 | if ((Z_OK != |
126 | uncompress ((Bytef *) ret, &dlen, (const Bytef *) &msg[1], | 126 | uncompress ((Bytef *) ret, &dlen, (const Bytef *) &msg[1], |
@@ -242,7 +242,7 @@ GSC_TYPEMAP_extend (const struct GSC_TypeMap *tmap, const uint16_t * types, | |||
242 | struct GSC_TypeMap *ret; | 242 | struct GSC_TypeMap *ret; |
243 | unsigned int i; | 243 | unsigned int i; |
244 | 244 | ||
245 | ret = GNUNET_malloc (sizeof (struct GSC_TypeMap)); | 245 | ret = GNUNET_new (struct GSC_TypeMap); |
246 | if (NULL != tmap) | 246 | if (NULL != tmap) |
247 | memcpy (ret, tmap, sizeof (struct GSC_TypeMap)); | 247 | memcpy (ret, tmap, sizeof (struct GSC_TypeMap)); |
248 | for (i = 0; i < tcnt; i++) | 248 | for (i = 0; i < tcnt; i++) |
@@ -259,7 +259,7 @@ GSC_TYPEMAP_extend (const struct GSC_TypeMap *tmap, const uint16_t * types, | |||
259 | struct GSC_TypeMap * | 259 | struct GSC_TypeMap * |
260 | GSC_TYPEMAP_create () | 260 | GSC_TYPEMAP_create () |
261 | { | 261 | { |
262 | return GNUNET_malloc (sizeof (struct GSC_TypeMap)); | 262 | return GNUNET_new (struct GSC_TypeMap); |
263 | } | 263 | } |
264 | 264 | ||
265 | 265 | ||
diff --git a/src/datacache/datacache.c b/src/datacache/datacache.c index c96432946..d7adb8b4d 100644 --- a/src/datacache/datacache.c +++ b/src/datacache/datacache.c | |||
@@ -153,7 +153,7 @@ GNUNET_DATACACHE_create (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
153 | } | 153 | } |
154 | bf_size = quota / 32; /* 8 bit per entry, 1 bit per 32 kb in DB */ | 154 | bf_size = quota / 32; /* 8 bit per entry, 1 bit per 32 kb in DB */ |
155 | 155 | ||
156 | ret = GNUNET_malloc (sizeof (struct GNUNET_DATACACHE_Handle)); | 156 | ret = GNUNET_new (struct GNUNET_DATACACHE_Handle); |
157 | 157 | ||
158 | if (GNUNET_YES != | 158 | if (GNUNET_YES != |
159 | GNUNET_CONFIGURATION_get_value_yesno (cfg, section, "DISABLE_BF")) | 159 | GNUNET_CONFIGURATION_get_value_yesno (cfg, section, "DISABLE_BF")) |
diff --git a/src/datacache/plugin_datacache_heap.c b/src/datacache/plugin_datacache_heap.c index 85cf9487e..9689d4f05 100644 --- a/src/datacache/plugin_datacache_heap.c +++ b/src/datacache/plugin_datacache_heap.c | |||
@@ -393,12 +393,12 @@ libgnunet_plugin_datacache_heap_init (void *cls) | |||
393 | struct GNUNET_DATACACHE_PluginFunctions *api; | 393 | struct GNUNET_DATACACHE_PluginFunctions *api; |
394 | struct Plugin *plugin; | 394 | struct Plugin *plugin; |
395 | 395 | ||
396 | plugin = GNUNET_malloc (sizeof (struct Plugin)); | 396 | plugin = GNUNET_new (struct Plugin); |
397 | plugin->map = GNUNET_CONTAINER_multihashmap_create (1024, /* FIXME: base on quota! */ | 397 | plugin->map = GNUNET_CONTAINER_multihashmap_create (1024, /* FIXME: base on quota! */ |
398 | GNUNET_YES); | 398 | GNUNET_YES); |
399 | plugin->heap = GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MIN); | 399 | plugin->heap = GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MIN); |
400 | plugin->env = env; | 400 | plugin->env = env; |
401 | api = GNUNET_malloc (sizeof (struct GNUNET_DATACACHE_PluginFunctions)); | 401 | api = GNUNET_new (struct GNUNET_DATACACHE_PluginFunctions); |
402 | api->cls = plugin; | 402 | api->cls = plugin; |
403 | api->get = &heap_plugin_get; | 403 | api->get = &heap_plugin_get; |
404 | api->put = &heap_plugin_put; | 404 | api->put = &heap_plugin_put; |
diff --git a/src/datacache/plugin_datacache_postgres.c b/src/datacache/plugin_datacache_postgres.c index 6d7e28021..150a9d5dc 100644 --- a/src/datacache/plugin_datacache_postgres.c +++ b/src/datacache/plugin_datacache_postgres.c | |||
@@ -374,7 +374,7 @@ libgnunet_plugin_datacache_postgres_init (void *cls) | |||
374 | struct GNUNET_DATACACHE_PluginFunctions *api; | 374 | struct GNUNET_DATACACHE_PluginFunctions *api; |
375 | struct Plugin *plugin; | 375 | struct Plugin *plugin; |
376 | 376 | ||
377 | plugin = GNUNET_malloc (sizeof (struct Plugin)); | 377 | plugin = GNUNET_new (struct Plugin); |
378 | plugin->env = env; | 378 | plugin->env = env; |
379 | 379 | ||
380 | if (GNUNET_OK != init_connection (plugin)) | 380 | if (GNUNET_OK != init_connection (plugin)) |
@@ -383,7 +383,7 @@ libgnunet_plugin_datacache_postgres_init (void *cls) | |||
383 | return NULL; | 383 | return NULL; |
384 | } | 384 | } |
385 | 385 | ||
386 | api = GNUNET_malloc (sizeof (struct GNUNET_DATACACHE_PluginFunctions)); | 386 | api = GNUNET_new (struct GNUNET_DATACACHE_PluginFunctions); |
387 | api->cls = plugin; | 387 | api->cls = plugin; |
388 | api->get = &postgres_plugin_get; | 388 | api->get = &postgres_plugin_get; |
389 | api->put = &postgres_plugin_put; | 389 | api->put = &postgres_plugin_put; |
diff --git a/src/datacache/plugin_datacache_sqlite.c b/src/datacache/plugin_datacache_sqlite.c index 1901bdedd..b7f1757ca 100644 --- a/src/datacache/plugin_datacache_sqlite.c +++ b/src/datacache/plugin_datacache_sqlite.c | |||
@@ -438,11 +438,11 @@ libgnunet_plugin_datacache_sqlite_init (void *cls) | |||
438 | " path BLOB DEFAULT '')"); | 438 | " path BLOB DEFAULT '')"); |
439 | SQLITE3_EXEC (dbh, "CREATE INDEX idx_hashidx ON ds090 (key,type,expire)"); | 439 | SQLITE3_EXEC (dbh, "CREATE INDEX idx_hashidx ON ds090 (key,type,expire)"); |
440 | SQLITE3_EXEC (dbh, "CREATE INDEX idx_expire ON ds090 (expire)"); | 440 | SQLITE3_EXEC (dbh, "CREATE INDEX idx_expire ON ds090 (expire)"); |
441 | plugin = GNUNET_malloc (sizeof (struct Plugin)); | 441 | plugin = GNUNET_new (struct Plugin); |
442 | plugin->env = env; | 442 | plugin->env = env; |
443 | plugin->dbh = dbh; | 443 | plugin->dbh = dbh; |
444 | plugin->fn = fn_utf8; | 444 | plugin->fn = fn_utf8; |
445 | api = GNUNET_malloc (sizeof (struct GNUNET_DATACACHE_PluginFunctions)); | 445 | api = GNUNET_new (struct GNUNET_DATACACHE_PluginFunctions); |
446 | api->cls = plugin; | 446 | api->cls = plugin; |
447 | api->get = &sqlite_plugin_get; | 447 | api->get = &sqlite_plugin_get; |
448 | api->put = &sqlite_plugin_put; | 448 | api->put = &sqlite_plugin_put; |
diff --git a/src/datacache/plugin_datacache_template.c b/src/datacache/plugin_datacache_template.c index 306615571..205cc66c7 100644 --- a/src/datacache/plugin_datacache_template.c +++ b/src/datacache/plugin_datacache_template.c | |||
@@ -114,9 +114,9 @@ libgnunet_plugin_datacache_template_init (void *cls) | |||
114 | struct GNUNET_DATACACHE_PluginFunctions *api; | 114 | struct GNUNET_DATACACHE_PluginFunctions *api; |
115 | struct Plugin *plugin; | 115 | struct Plugin *plugin; |
116 | 116 | ||
117 | plugin = GNUNET_malloc (sizeof (struct Plugin)); | 117 | plugin = GNUNET_new (struct Plugin); |
118 | plugin->env = env; | 118 | plugin->env = env; |
119 | api = GNUNET_malloc (sizeof (struct GNUNET_DATACACHE_PluginFunctions)); | 119 | api = GNUNET_new (struct GNUNET_DATACACHE_PluginFunctions); |
120 | api->cls = plugin; | 120 | api->cls = plugin; |
121 | api->get = &template_plugin_get; | 121 | api->get = &template_plugin_get; |
122 | api->put = &template_plugin_put; | 122 | api->put = &template_plugin_put; |
diff --git a/src/datastore/gnunet-service-datastore.c b/src/datastore/gnunet-service-datastore.c index 7c4c47e90..98ef6d797 100644 --- a/src/datastore/gnunet-service-datastore.c +++ b/src/datastore/gnunet-service-datastore.c | |||
@@ -516,7 +516,7 @@ transmit (struct GNUNET_SERVER_Client *client, struct GNUNET_MessageHeader *msg) | |||
516 | GNUNET_free (msg); | 516 | GNUNET_free (msg); |
517 | return; | 517 | return; |
518 | } | 518 | } |
519 | tcc = GNUNET_malloc (sizeof (struct TransmitCallbackContext)); | 519 | tcc = GNUNET_new (struct TransmitCallbackContext); |
520 | tcc->msg = msg; | 520 | tcc->msg = msg; |
521 | tcc->client = client; | 521 | tcc->client = client; |
522 | if (NULL == | 522 | if (NULL == |
@@ -598,7 +598,7 @@ transmit_item (void *cls, const struct GNUNET_HashCode * key, uint32_t size, | |||
598 | /* transmit 'DATA_END' */ | 598 | /* transmit 'DATA_END' */ |
599 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transmitting `%s' message\n", | 599 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transmitting `%s' message\n", |
600 | "DATA_END"); | 600 | "DATA_END"); |
601 | end = GNUNET_malloc (sizeof (struct GNUNET_MessageHeader)); | 601 | end = GNUNET_new (struct GNUNET_MessageHeader); |
602 | end->size = htons (sizeof (struct GNUNET_MessageHeader)); | 602 | end->size = htons (sizeof (struct GNUNET_MessageHeader)); |
603 | end->type = htons (GNUNET_MESSAGE_TYPE_DATASTORE_DATA_END); | 603 | end->type = htons (GNUNET_MESSAGE_TYPE_DATASTORE_DATA_END); |
604 | transmit (client, end); | 604 | transmit (client, end); |
@@ -698,7 +698,7 @@ handle_reserve (void *cls, struct GNUNET_SERVER_Client *client, | |||
698 | reserved += req; | 698 | reserved += req; |
699 | GNUNET_STATISTICS_set (stats, gettext_noop ("# reserved"), reserved, | 699 | GNUNET_STATISTICS_set (stats, gettext_noop ("# reserved"), reserved, |
700 | GNUNET_NO); | 700 | GNUNET_NO); |
701 | e = GNUNET_malloc (sizeof (struct ReservationList)); | 701 | e = GNUNET_new (struct ReservationList); |
702 | e->next = reservations; | 702 | e->next = reservations; |
703 | reservations = e; | 703 | reservations = e; |
704 | e->client = client; | 704 | e->client = client; |
@@ -1274,7 +1274,7 @@ load_plugin () | |||
1274 | struct DatastorePlugin *ret; | 1274 | struct DatastorePlugin *ret; |
1275 | char *libname; | 1275 | char *libname; |
1276 | 1276 | ||
1277 | ret = GNUNET_malloc (sizeof (struct DatastorePlugin)); | 1277 | ret = GNUNET_new (struct DatastorePlugin); |
1278 | ret->env.cfg = cfg; | 1278 | ret->env.cfg = cfg; |
1279 | ret->env.duc = &disk_utilization_change_cb; | 1279 | ret->env.duc = &disk_utilization_change_cb; |
1280 | ret->env.cls = NULL; | 1280 | ret->env.cls = NULL; |
diff --git a/src/datastore/perf_datastore_api.c b/src/datastore/perf_datastore_api.c index c51502cc6..90f72d6ee 100644 --- a/src/datastore/perf_datastore_api.c +++ b/src/datastore/perf_datastore_api.c | |||
@@ -303,7 +303,7 @@ run (void *cls, | |||
303 | 303 | ||
304 | datastore = GNUNET_DATASTORE_connect (cfg); | 304 | datastore = GNUNET_DATASTORE_connect (cfg); |
305 | start_time = GNUNET_TIME_absolute_get (); | 305 | start_time = GNUNET_TIME_absolute_get (); |
306 | crc = GNUNET_malloc (sizeof (struct CpsRunContext)); | 306 | crc = GNUNET_new (struct CpsRunContext); |
307 | crc->cfg = cfg; | 307 | crc->cfg = cfg; |
308 | crc->phase = RP_PUT; | 308 | crc->phase = RP_PUT; |
309 | if (NULL == | 309 | if (NULL == |
diff --git a/src/datastore/perf_plugin_datastore.c b/src/datastore/perf_plugin_datastore.c index 908a7ee55..1dacb3783 100644 --- a/src/datastore/perf_plugin_datastore.c +++ b/src/datastore/perf_plugin_datastore.c | |||
@@ -459,7 +459,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
459 | "%s", "Could not initialize plugin, assuming database not configured. Test not run!\n"); | 459 | "%s", "Could not initialize plugin, assuming database not configured. Test not run!\n"); |
460 | return; | 460 | return; |
461 | } | 461 | } |
462 | crc = GNUNET_malloc (sizeof (struct CpsRunContext)); | 462 | crc = GNUNET_new (struct CpsRunContext); |
463 | crc->api = api; | 463 | crc->api = api; |
464 | crc->cfg = c; | 464 | crc->cfg = c; |
465 | crc->phase = RP_PUT; | 465 | crc->phase = RP_PUT; |
diff --git a/src/datastore/plugin_datastore_heap.c b/src/datastore/plugin_datastore_heap.c index 1f756a95c..8f7f3d1de 100644 --- a/src/datastore/plugin_datastore_heap.c +++ b/src/datastore/plugin_datastore_heap.c | |||
@@ -240,7 +240,7 @@ heap_plugin_put (void *cls, | |||
240 | break; | 240 | break; |
241 | if (NULL == zabt) | 241 | if (NULL == zabt) |
242 | { | 242 | { |
243 | zabt = GNUNET_malloc (sizeof (struct ZeroAnonByType)); | 243 | zabt = GNUNET_new (struct ZeroAnonByType); |
244 | zabt->type = type; | 244 | zabt->type = type; |
245 | GNUNET_CONTAINER_DLL_insert (plugin->zero_head, | 245 | GNUNET_CONTAINER_DLL_insert (plugin->zero_head, |
246 | plugin->zero_tail, | 246 | plugin->zero_tail, |
@@ -800,12 +800,12 @@ libgnunet_plugin_datastore_heap_init (void *cls) | |||
800 | "HASHMAPSIZE", | 800 | "HASHMAPSIZE", |
801 | &esize)) | 801 | &esize)) |
802 | esize = 128 * 1024; | 802 | esize = 128 * 1024; |
803 | plugin = GNUNET_malloc (sizeof (struct Plugin)); | 803 | plugin = GNUNET_new (struct Plugin); |
804 | plugin->env = env; | 804 | plugin->env = env; |
805 | plugin->keyvalue = GNUNET_CONTAINER_multihashmap_create (esize, GNUNET_YES); | 805 | plugin->keyvalue = GNUNET_CONTAINER_multihashmap_create (esize, GNUNET_YES); |
806 | plugin->by_expiration = GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MIN); | 806 | plugin->by_expiration = GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MIN); |
807 | plugin->by_replication = GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MAX); | 807 | plugin->by_replication = GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MAX); |
808 | api = GNUNET_malloc (sizeof (struct GNUNET_DATASTORE_PluginFunctions)); | 808 | api = GNUNET_new (struct GNUNET_DATASTORE_PluginFunctions); |
809 | api->cls = plugin; | 809 | api->cls = plugin; |
810 | api->estimate_size = &heap_plugin_estimate_size; | 810 | api->estimate_size = &heap_plugin_estimate_size; |
811 | api->put = &heap_plugin_put; | 811 | api->put = &heap_plugin_put; |
diff --git a/src/datastore/plugin_datastore_mysql.c b/src/datastore/plugin_datastore_mysql.c index cf0172583..fab10b206 100644 --- a/src/datastore/plugin_datastore_mysql.c +++ b/src/datastore/plugin_datastore_mysql.c | |||
@@ -946,7 +946,7 @@ libgnunet_plugin_datastore_mysql_init (void *cls) | |||
946 | struct GNUNET_DATASTORE_PluginFunctions *api; | 946 | struct GNUNET_DATASTORE_PluginFunctions *api; |
947 | struct Plugin *plugin; | 947 | struct Plugin *plugin; |
948 | 948 | ||
949 | plugin = GNUNET_malloc (sizeof (struct Plugin)); | 949 | plugin = GNUNET_new (struct Plugin); |
950 | plugin->env = env; | 950 | plugin->env = env; |
951 | plugin->mc = GNUNET_MYSQL_context_create (env->cfg, "datastore-mysql"); | 951 | plugin->mc = GNUNET_MYSQL_context_create (env->cfg, "datastore-mysql"); |
952 | if (NULL == plugin->mc) | 952 | if (NULL == plugin->mc) |
@@ -1007,7 +1007,7 @@ libgnunet_plugin_datastore_mysql_init (void *cls) | |||
1007 | #undef PINIT | 1007 | #undef PINIT |
1008 | #undef MRUNS | 1008 | #undef MRUNS |
1009 | 1009 | ||
1010 | api = GNUNET_malloc (sizeof (struct GNUNET_DATASTORE_PluginFunctions)); | 1010 | api = GNUNET_new (struct GNUNET_DATASTORE_PluginFunctions); |
1011 | api->cls = plugin; | 1011 | api->cls = plugin; |
1012 | api->estimate_size = &mysql_plugin_estimate_size; | 1012 | api->estimate_size = &mysql_plugin_estimate_size; |
1013 | api->put = &mysql_plugin_put; | 1013 | api->put = &mysql_plugin_put; |
diff --git a/src/datastore/plugin_datastore_postgres.c b/src/datastore/plugin_datastore_postgres.c index 6a96ad5d3..79217c998 100644 --- a/src/datastore/plugin_datastore_postgres.c +++ b/src/datastore/plugin_datastore_postgres.c | |||
@@ -838,14 +838,14 @@ libgnunet_plugin_datastore_postgres_init (void *cls) | |||
838 | struct GNUNET_DATASTORE_PluginFunctions *api; | 838 | struct GNUNET_DATASTORE_PluginFunctions *api; |
839 | struct Plugin *plugin; | 839 | struct Plugin *plugin; |
840 | 840 | ||
841 | plugin = GNUNET_malloc (sizeof (struct Plugin)); | 841 | plugin = GNUNET_new (struct Plugin); |
842 | plugin->env = env; | 842 | plugin->env = env; |
843 | if (GNUNET_OK != init_connection (plugin)) | 843 | if (GNUNET_OK != init_connection (plugin)) |
844 | { | 844 | { |
845 | GNUNET_free (plugin); | 845 | GNUNET_free (plugin); |
846 | return NULL; | 846 | return NULL; |
847 | } | 847 | } |
848 | api = GNUNET_malloc (sizeof (struct GNUNET_DATASTORE_PluginFunctions)); | 848 | api = GNUNET_new (struct GNUNET_DATASTORE_PluginFunctions); |
849 | api->cls = plugin; | 849 | api->cls = plugin; |
850 | api->estimate_size = &postgres_plugin_estimate_size; | 850 | api->estimate_size = &postgres_plugin_estimate_size; |
851 | api->put = &postgres_plugin_put; | 851 | api->put = &postgres_plugin_put; |
diff --git a/src/datastore/plugin_datastore_sqlite.c b/src/datastore/plugin_datastore_sqlite.c index bd344dbb1..f2e0454f9 100644 --- a/src/datastore/plugin_datastore_sqlite.c +++ b/src/datastore/plugin_datastore_sqlite.c | |||
@@ -1179,7 +1179,7 @@ libgnunet_plugin_datastore_sqlite_init (void *cls) | |||
1179 | database_shutdown (&plugin); | 1179 | database_shutdown (&plugin); |
1180 | return NULL; | 1180 | return NULL; |
1181 | } | 1181 | } |
1182 | api = GNUNET_malloc (sizeof (struct GNUNET_DATASTORE_PluginFunctions)); | 1182 | api = GNUNET_new (struct GNUNET_DATASTORE_PluginFunctions); |
1183 | api->cls = &plugin; | 1183 | api->cls = &plugin; |
1184 | api->estimate_size = &sqlite_plugin_estimate_size; | 1184 | api->estimate_size = &sqlite_plugin_estimate_size; |
1185 | api->put = &sqlite_plugin_put; | 1185 | api->put = &sqlite_plugin_put; |
diff --git a/src/datastore/plugin_datastore_template.c b/src/datastore/plugin_datastore_template.c index 2978de4fe..5e577b1bc 100644 --- a/src/datastore/plugin_datastore_template.c +++ b/src/datastore/plugin_datastore_template.c | |||
@@ -240,9 +240,9 @@ libgnunet_plugin_datastore_template_init (void *cls) | |||
240 | struct GNUNET_DATASTORE_PluginFunctions *api; | 240 | struct GNUNET_DATASTORE_PluginFunctions *api; |
241 | struct Plugin *plugin; | 241 | struct Plugin *plugin; |
242 | 242 | ||
243 | plugin = GNUNET_malloc (sizeof (struct Plugin)); | 243 | plugin = GNUNET_new (struct Plugin); |
244 | plugin->env = env; | 244 | plugin->env = env; |
245 | api = GNUNET_malloc (sizeof (struct GNUNET_DATASTORE_PluginFunctions)); | 245 | api = GNUNET_new (struct GNUNET_DATASTORE_PluginFunctions); |
246 | api->cls = plugin; | 246 | api->cls = plugin; |
247 | api->estimate_size = &template_plugin_estimate_size; | 247 | api->estimate_size = &template_plugin_estimate_size; |
248 | api->put = &template_plugin_put; | 248 | api->put = &template_plugin_put; |
diff --git a/src/datastore/test_datastore_api.c b/src/datastore/test_datastore_api.c index 03939cee3..26d0f1343 100644 --- a/src/datastore/test_datastore_api.c +++ b/src/datastore/test_datastore_api.c | |||
@@ -471,7 +471,7 @@ run (void *cls, | |||
471 | struct CpsRunContext *crc; | 471 | struct CpsRunContext *crc; |
472 | static struct GNUNET_HashCode zkey; | 472 | static struct GNUNET_HashCode zkey; |
473 | 473 | ||
474 | crc = GNUNET_malloc (sizeof (struct CpsRunContext)); | 474 | crc = GNUNET_new (struct CpsRunContext); |
475 | crc->cfg = cfg; | 475 | crc->cfg = cfg; |
476 | crc->phase = RP_PUT; | 476 | crc->phase = RP_PUT; |
477 | now = GNUNET_TIME_absolute_get (); | 477 | now = GNUNET_TIME_absolute_get (); |
diff --git a/src/datastore/test_datastore_api_management.c b/src/datastore/test_datastore_api_management.c index 7f330031a..5553e5c0b 100644 --- a/src/datastore/test_datastore_api_management.c +++ b/src/datastore/test_datastore_api_management.c | |||
@@ -265,7 +265,7 @@ run (void *cls, | |||
265 | struct CpsRunContext *crc; | 265 | struct CpsRunContext *crc; |
266 | static struct GNUNET_HashCode zkey; | 266 | static struct GNUNET_HashCode zkey; |
267 | 267 | ||
268 | crc = GNUNET_malloc (sizeof (struct CpsRunContext)); | 268 | crc = GNUNET_new (struct CpsRunContext); |
269 | crc->cfg = cfg; | 269 | crc->cfg = cfg; |
270 | crc->phase = RP_PUT; | 270 | crc->phase = RP_PUT; |
271 | now = GNUNET_TIME_absolute_get (); | 271 | now = GNUNET_TIME_absolute_get (); |
diff --git a/src/datastore/test_plugin_datastore.c b/src/datastore/test_plugin_datastore.c index 844d32a7b..4eefcaefa 100644 --- a/src/datastore/test_plugin_datastore.c +++ b/src/datastore/test_plugin_datastore.c | |||
@@ -345,7 +345,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
345 | "%s", "Could not initialize plugin, assuming database not configured. Test not run!\n"); | 345 | "%s", "Could not initialize plugin, assuming database not configured. Test not run!\n"); |
346 | return; | 346 | return; |
347 | } | 347 | } |
348 | crc = GNUNET_malloc (sizeof (struct CpsRunContext)); | 348 | crc = GNUNET_new (struct CpsRunContext); |
349 | crc->api = api; | 349 | crc->api = api; |
350 | crc->cfg = c; | 350 | crc->cfg = c; |
351 | crc->phase = RP_PUT; | 351 | crc->phase = RP_PUT; |
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, | |||
201 | { | 201 | { |
202 | struct GNUNET_DHT_TEST_Context *ctx; | 202 | struct GNUNET_DHT_TEST_Context *ctx; |
203 | 203 | ||
204 | ctx = GNUNET_malloc (sizeof (struct GNUNET_DHT_TEST_Context)); | 204 | ctx = GNUNET_new (struct GNUNET_DHT_TEST_Context); |
205 | ctx->num_peers = num_peers; | 205 | ctx->num_peers = num_peers; |
206 | ctx->ops = GNUNET_malloc (num_peers * sizeof (struct GNUNET_TESTBED_Operation *)); | 206 | ctx->ops = GNUNET_malloc (num_peers * sizeof (struct GNUNET_TESTBED_Operation *)); |
207 | ctx->dhts = GNUNET_malloc (num_peers * sizeof (struct GNUNET_DHT_Handle *)); | 207 | 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, | |||
822 | const struct GNUNET_DHT_MonitorStartStopMessage *msg; | 822 | const struct GNUNET_DHT_MonitorStartStopMessage *msg; |
823 | 823 | ||
824 | msg = (struct GNUNET_DHT_MonitorStartStopMessage *) message; | 824 | msg = (struct GNUNET_DHT_MonitorStartStopMessage *) message; |
825 | r = GNUNET_malloc (sizeof(struct ClientMonitorRecord)); | 825 | r = GNUNET_new (struct ClientMonitorRecord); |
826 | 826 | ||
827 | r->client = find_active_client(client); | 827 | r->client = find_active_client(client); |
828 | r->type = ntohl(msg->type); | 828 | r->type = ntohl(msg->type); |
@@ -833,7 +833,7 @@ handle_dht_local_monitor (void *cls, struct GNUNET_SERVER_Client *client, | |||
833 | r->key = NULL; | 833 | r->key = NULL; |
834 | else | 834 | else |
835 | { | 835 | { |
836 | r->key = GNUNET_malloc (sizeof (struct GNUNET_HashCode)); | 836 | r->key = GNUNET_new (struct GNUNET_HashCode); |
837 | memcpy (r->key, &msg->key, sizeof (struct GNUNET_HashCode)); | 837 | memcpy (r->key, &msg->key, sizeof (struct GNUNET_HashCode)); |
838 | } | 838 | } |
839 | GNUNET_CONTAINER_DLL_insert (monitor_head, monitor_tail, r); | 839 | 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) | |||
666 | &phash); | 666 | &phash); |
667 | peer_bucket = find_bucket (&phash); | 667 | peer_bucket = find_bucket (&phash); |
668 | GNUNET_assert ((peer_bucket >= 0) && (peer_bucket < MAX_BUCKETS)); | 668 | GNUNET_assert ((peer_bucket >= 0) && (peer_bucket < MAX_BUCKETS)); |
669 | ret = GNUNET_malloc (sizeof (struct PeerInfo)); | 669 | ret = GNUNET_new (struct PeerInfo); |
670 | #if 0 | 670 | #if 0 |
671 | ret->latency = latency; | 671 | ret->latency = latency; |
672 | ret->distance = distance; | 672 | 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, | |||
822 | const struct GNUNET_DHT_MonitorStartStopMessage *msg; | 822 | const struct GNUNET_DHT_MonitorStartStopMessage *msg; |
823 | 823 | ||
824 | msg = (struct GNUNET_DHT_MonitorStartStopMessage *) message; | 824 | msg = (struct GNUNET_DHT_MonitorStartStopMessage *) message; |
825 | r = GNUNET_malloc (sizeof(struct ClientMonitorRecord)); | 825 | r = GNUNET_new (struct ClientMonitorRecord); |
826 | 826 | ||
827 | r->client = find_active_client(client); | 827 | r->client = find_active_client(client); |
828 | r->type = ntohl(msg->type); | 828 | r->type = ntohl(msg->type); |
@@ -833,7 +833,7 @@ handle_dht_local_monitor (void *cls, struct GNUNET_SERVER_Client *client, | |||
833 | r->key = NULL; | 833 | r->key = NULL; |
834 | else | 834 | else |
835 | { | 835 | { |
836 | r->key = GNUNET_malloc (sizeof (struct GNUNET_HashCode)); | 836 | r->key = GNUNET_new (struct GNUNET_HashCode); |
837 | memcpy (r->key, &msg->key, sizeof (struct GNUNET_HashCode)); | 837 | memcpy (r->key, &msg->key, sizeof (struct GNUNET_HashCode)); |
838 | } | 838 | } |
839 | GNUNET_CONTAINER_DLL_insert (monitor_head, monitor_tail, r); | 839 | 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) | |||
666 | &phash); | 666 | &phash); |
667 | peer_bucket = find_bucket (&phash); | 667 | peer_bucket = find_bucket (&phash); |
668 | GNUNET_assert ((peer_bucket >= 0) && (peer_bucket < MAX_BUCKETS)); | 668 | GNUNET_assert ((peer_bucket >= 0) && (peer_bucket < MAX_BUCKETS)); |
669 | ret = GNUNET_malloc (sizeof (struct PeerInfo)); | 669 | ret = GNUNET_new (struct PeerInfo); |
670 | #if 0 | 670 | #if 0 |
671 | ret->latency = latency; | 671 | ret->latency = latency; |
672 | ret->distance = distance; | 672 | 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) | |||
172 | }; | 172 | }; |
173 | struct GNUNET_BLOCK_PluginFunctions *api; | 173 | struct GNUNET_BLOCK_PluginFunctions *api; |
174 | 174 | ||
175 | api = GNUNET_malloc (sizeof (struct GNUNET_BLOCK_PluginFunctions)); | 175 | api = GNUNET_new (struct GNUNET_BLOCK_PluginFunctions); |
176 | api->evaluate = &block_plugin_dht_evaluate; | 176 | api->evaluate = &block_plugin_dht_evaluate; |
177 | api->get_key = &block_plugin_dht_get_key; | 177 | api->get_key = &block_plugin_dht_get_key; |
178 | api->types = types; | 178 | 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, | |||
380 | GNUNET_CRYPTO_hash (&i, sizeof (i), &key); | 380 | GNUNET_CRYPTO_hash (&i, sizeof (i), &key); |
381 | for (j=0;j<num_peers;j++) | 381 | for (j=0;j<num_peers;j++) |
382 | { | 382 | { |
383 | get_op = GNUNET_malloc (sizeof (struct GetOperation)); | 383 | get_op = GNUNET_new (struct GetOperation); |
384 | GNUNET_CONTAINER_DLL_insert (get_head, | 384 | GNUNET_CONTAINER_DLL_insert (get_head, |
385 | get_tail, | 385 | get_tail, |
386 | get_op); | 386 | 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, | |||
382 | GNUNET_CRYPTO_hash (&i, sizeof (i), &key); | 382 | GNUNET_CRYPTO_hash (&i, sizeof (i), &key); |
383 | for (j=0;j<num_peers;j++) | 383 | for (j=0;j<num_peers;j++) |
384 | { | 384 | { |
385 | get_op = GNUNET_malloc (sizeof (struct GetOperation)); | 385 | get_op = GNUNET_new (struct GetOperation); |
386 | GNUNET_CONTAINER_DLL_insert (get_head, | 386 | GNUNET_CONTAINER_DLL_insert (get_head, |
387 | get_tail, | 387 | get_tail, |
388 | get_op); | 388 | get_op); |
diff --git a/src/dns/dns_api.c b/src/dns/dns_api.c index 9a8e1ca2d..288b421c6 100644 --- a/src/dns/dns_api.c +++ b/src/dns/dns_api.c | |||
@@ -258,7 +258,7 @@ request_handler (void *cls, | |||
258 | GNUNET_TIME_UNIT_FOREVER_REL); | 258 | GNUNET_TIME_UNIT_FOREVER_REL); |
259 | 259 | ||
260 | /* finally, pass request to callback for answers */ | 260 | /* finally, pass request to callback for answers */ |
261 | rh = GNUNET_malloc (sizeof (struct GNUNET_DNS_RequestHandle)); | 261 | rh = GNUNET_new (struct GNUNET_DNS_RequestHandle); |
262 | rh->dh =dh; | 262 | rh->dh =dh; |
263 | rh->request_id = req->request_id; | 263 | rh->request_id = req->request_id; |
264 | rh->generation = dh->generation; | 264 | rh->generation = dh->generation; |
@@ -490,7 +490,7 @@ GNUNET_DNS_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
490 | { | 490 | { |
491 | struct GNUNET_DNS_Handle *dh; | 491 | struct GNUNET_DNS_Handle *dh; |
492 | 492 | ||
493 | dh = GNUNET_malloc (sizeof (struct GNUNET_DNS_Handle)); | 493 | dh = GNUNET_new (struct GNUNET_DNS_Handle); |
494 | dh->cfg = cfg; | 494 | dh->cfg = cfg; |
495 | dh->flags = flags; | 495 | dh->flags = flags; |
496 | dh->rh = rh; | 496 | dh->rh = rh; |
diff --git a/src/dns/dnsstub.c b/src/dns/dnsstub.c index e494d24a2..51d6c2c21 100644 --- a/src/dns/dnsstub.c +++ b/src/dns/dnsstub.c | |||
@@ -530,7 +530,7 @@ GNUNET_DNSSTUB_start (const char *dns_ip) | |||
530 | { | 530 | { |
531 | struct GNUNET_DNSSTUB_Context *ctx; | 531 | struct GNUNET_DNSSTUB_Context *ctx; |
532 | 532 | ||
533 | ctx = GNUNET_malloc (sizeof (struct GNUNET_DNSSTUB_Context)); | 533 | ctx = GNUNET_new (struct GNUNET_DNSSTUB_Context); |
534 | if (NULL != dns_ip) | 534 | if (NULL != dns_ip) |
535 | ctx->dns_exit = GNUNET_strdup (dns_ip); | 535 | ctx->dns_exit = GNUNET_strdup (dns_ip); |
536 | return ctx; | 536 | return ctx; |
diff --git a/src/dns/gnunet-service-dns.c b/src/dns/gnunet-service-dns.c index ded21605a..0b130f478 100644 --- a/src/dns/gnunet-service-dns.c +++ b/src/dns/gnunet-service-dns.c | |||
@@ -743,7 +743,7 @@ handle_client_init (void *cls GNUNET_UNUSED, | |||
743 | struct ClientRecord *cr; | 743 | struct ClientRecord *cr; |
744 | const struct GNUNET_DNS_Register *reg = (const struct GNUNET_DNS_Register*) message; | 744 | const struct GNUNET_DNS_Register *reg = (const struct GNUNET_DNS_Register*) message; |
745 | 745 | ||
746 | cr = GNUNET_malloc (sizeof (struct ClientRecord)); | 746 | cr = GNUNET_new (struct ClientRecord); |
747 | cr->client = client; | 747 | cr->client = client; |
748 | cr->flags = (enum GNUNET_DNS_Flags) ntohl (reg->flags); | 748 | cr->flags = (enum GNUNET_DNS_Flags) ntohl (reg->flags); |
749 | GNUNET_SERVER_client_keep (client); | 749 | GNUNET_SERVER_client_keep (client); |
diff --git a/src/env/env.c b/src/env/env.c index 33d12c01e..1a8c1a568 100644 --- a/src/env/env.c +++ b/src/env/env.c | |||
@@ -68,7 +68,7 @@ GNUNET_ENV_environment_add_mod (struct GNUNET_ENV_Environment *env, | |||
68 | enum GNUNET_ENV_Operator oper, const char *name, | 68 | enum GNUNET_ENV_Operator oper, const char *name, |
69 | const void *value, size_t value_size) | 69 | const void *value, size_t value_size) |
70 | { | 70 | { |
71 | struct GNUNET_ENV_Modifier *mod = GNUNET_malloc (sizeof (*mod)); | 71 | struct GNUNET_ENV_Modifier *mod = GNUNET_new (struct GNUNET_ENV_Modifier); |
72 | mod->oper = oper; | 72 | mod->oper = oper; |
73 | mod->name = name; | 73 | mod->name = name; |
74 | mod->value = value; | 74 | mod->value = value; |
diff --git a/src/experimentation/gnunet-daemon-experimentation_nodes.c b/src/experimentation/gnunet-daemon-experimentation_nodes.c index aa8a0dbbe..65b2d9c38 100644 --- a/src/experimentation/gnunet-daemon-experimentation_nodes.c +++ b/src/experimentation/gnunet-daemon-experimentation_nodes.c | |||
@@ -1044,7 +1044,7 @@ GED_nodes_send_start_ack (struct Node *n, struct Experiment *e) | |||
1044 | "Sending %s for experiment request to peer `%s' for experiment `%s'\n", | 1044 | "Sending %s for experiment request to peer `%s' for experiment `%s'\n", |
1045 | "START_ACK" ,GNUNET_i2s(&n->id), e->name); | 1045 | "START_ACK" ,GNUNET_i2s(&n->id), e->name); |
1046 | 1046 | ||
1047 | e_ctx = GNUNET_malloc (sizeof (struct NodeComCtx)); | 1047 | e_ctx = GNUNET_new (struct NodeComCtx); |
1048 | e_ctx->n = n; | 1048 | e_ctx->n = n; |
1049 | e_ctx->e = e; | 1049 | e_ctx->e = e; |
1050 | e_ctx->size = sizeof (struct GED_start_ack_message) + strlen (e->name) + 1; | 1050 | e_ctx->size = sizeof (struct GED_start_ack_message) + strlen (e->name) + 1; |
@@ -1071,7 +1071,7 @@ GED_nodes_send_start (struct Node *n, struct Experiment *e) | |||
1071 | "Sending %s for experiment request to peer `%s' for experiment `%s'\n", | 1071 | "Sending %s for experiment request to peer `%s' for experiment `%s'\n", |
1072 | "START", GNUNET_i2s(&n->id), e->name); | 1072 | "START", GNUNET_i2s(&n->id), e->name); |
1073 | 1073 | ||
1074 | e_ctx = GNUNET_malloc (sizeof (struct NodeComCtx)); | 1074 | e_ctx = GNUNET_new (struct NodeComCtx); |
1075 | e_ctx->n = n; | 1075 | e_ctx->n = n; |
1076 | e_ctx->e = e; | 1076 | e_ctx->e = e; |
1077 | e_ctx->size = sizeof (struct GED_start_message) + strlen (e->name) + 1; | 1077 | e_ctx->size = sizeof (struct GED_start_message) + strlen (e->name) + 1; |
diff --git a/src/experimentation/gnunet-daemon-experimentation_scheduler.c b/src/experimentation/gnunet-daemon-experimentation_scheduler.c index a52d60c37..c13434e9b 100644 --- a/src/experimentation/gnunet-daemon-experimentation_scheduler.c +++ b/src/experimentation/gnunet-daemon-experimentation_scheduler.c | |||
@@ -330,7 +330,7 @@ GED_scheduler_add (struct Node *n, struct Experiment *e, int outbound) | |||
330 | return; /* End of experiment is reached */ | 330 | return; /* End of experiment is reached */ |
331 | 331 | ||
332 | /* Add additional checks here if required */ | 332 | /* Add additional checks here if required */ |
333 | se = GNUNET_malloc (sizeof (struct ScheduledExperiment)); | 333 | se = GNUNET_new (struct ScheduledExperiment); |
334 | se->state = NOT_RUNNING; | 334 | se->state = NOT_RUNNING; |
335 | se->outbound = outbound; | 335 | se->outbound = outbound; |
336 | se->e = e; | 336 | se->e = e; |
diff --git a/src/fragmentation/defragmentation.c b/src/fragmentation/defragmentation.c index 5f9eace13..478a9c658 100644 --- a/src/fragmentation/defragmentation.c +++ b/src/fragmentation/defragmentation.c | |||
@@ -210,7 +210,7 @@ GNUNET_DEFRAGMENT_context_create (struct GNUNET_STATISTICS_Handle *stats, | |||
210 | { | 210 | { |
211 | struct GNUNET_DEFRAGMENT_Context *dc; | 211 | struct GNUNET_DEFRAGMENT_Context *dc; |
212 | 212 | ||
213 | dc = GNUNET_malloc (sizeof (struct GNUNET_DEFRAGMENT_Context)); | 213 | dc = GNUNET_new (struct GNUNET_DEFRAGMENT_Context); |
214 | dc->stats = stats; | 214 | dc->stats = stats; |
215 | dc->cls = cls; | 215 | dc->cls = cls; |
216 | dc->proc = proc; | 216 | dc->proc = proc; |
diff --git a/src/fs/fs_api.c b/src/fs/fs_api.c index 72d5eab15..3b8d125ad 100644 --- a/src/fs/fs_api.c +++ b/src/fs/fs_api.c | |||
@@ -371,7 +371,7 @@ GNUNET_FS_make_top (struct GNUNET_FS_Handle *h, SuspendSignalFunction ssf, | |||
371 | { | 371 | { |
372 | struct TopLevelActivity *ret; | 372 | struct TopLevelActivity *ret; |
373 | 373 | ||
374 | ret = GNUNET_malloc (sizeof (struct TopLevelActivity)); | 374 | ret = GNUNET_new (struct TopLevelActivity); |
375 | ret->ssf = ssf; | 375 | ret->ssf = ssf; |
376 | ret->ssf_cls = ssf_cls; | 376 | ret->ssf_cls = ssf_cls; |
377 | GNUNET_CONTAINER_DLL_insert (h->top_head, h->top_tail, ret); | 377 | GNUNET_CONTAINER_DLL_insert (h->top_head, h->top_tail, ret); |
@@ -852,7 +852,7 @@ deserialize_fi_node (struct GNUNET_FS_Handle *h, const char *fn, | |||
852 | GNUNET_break (0); | 852 | GNUNET_break (0); |
853 | return NULL; | 853 | return NULL; |
854 | } | 854 | } |
855 | ret = GNUNET_malloc (sizeof (struct GNUNET_FS_FileInformation)); | 855 | ret = GNUNET_new (struct GNUNET_FS_FileInformation); |
856 | ret->h = h; | 856 | ret->h = h; |
857 | ksks = NULL; | 857 | ksks = NULL; |
858 | chks = NULL; | 858 | chks = NULL; |
@@ -1769,7 +1769,7 @@ read_download_request (struct GNUNET_BIO_ReadHandle *rh) | |||
1769 | struct DownloadRequest *dr; | 1769 | struct DownloadRequest *dr; |
1770 | unsigned int i; | 1770 | unsigned int i; |
1771 | 1771 | ||
1772 | dr = GNUNET_malloc (sizeof (struct DownloadRequest)); | 1772 | dr = GNUNET_new (struct DownloadRequest); |
1773 | if ((GNUNET_OK != GNUNET_BIO_read_int32 (rh, &dr->state)) || | 1773 | if ((GNUNET_OK != GNUNET_BIO_read_int32 (rh, &dr->state)) || |
1774 | (GNUNET_OK != GNUNET_BIO_read_int64 (rh, &dr->offset)) || | 1774 | (GNUNET_OK != GNUNET_BIO_read_int64 (rh, &dr->offset)) || |
1775 | (GNUNET_OK != GNUNET_BIO_read_int32 (rh, &dr->num_children)) || | 1775 | (GNUNET_OK != GNUNET_BIO_read_int32 (rh, &dr->num_children)) || |
@@ -2127,7 +2127,7 @@ deserialize_unindex_file (void *cls, const char *filename) | |||
2127 | char *uris; | 2127 | char *uris; |
2128 | uint32_t state; | 2128 | uint32_t state; |
2129 | 2129 | ||
2130 | uc = GNUNET_malloc (sizeof (struct GNUNET_FS_UnindexContext)); | 2130 | uc = GNUNET_new (struct GNUNET_FS_UnindexContext); |
2131 | uc->h = h; | 2131 | uc->h = h; |
2132 | uc->serialization = get_serialization_short_name (filename); | 2132 | uc->serialization = get_serialization_short_name (filename); |
2133 | rh = GNUNET_BIO_read_open (filename); | 2133 | rh = GNUNET_BIO_read_open (filename); |
@@ -2994,7 +2994,7 @@ GNUNET_FS_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
2994 | enum GNUNET_FS_OPTIONS opt; | 2994 | enum GNUNET_FS_OPTIONS opt; |
2995 | va_list ap; | 2995 | va_list ap; |
2996 | 2996 | ||
2997 | ret = GNUNET_malloc (sizeof (struct GNUNET_FS_Handle)); | 2997 | ret = GNUNET_new (struct GNUNET_FS_Handle); |
2998 | ret->cfg = cfg; | 2998 | ret->cfg = cfg; |
2999 | ret->client_name = GNUNET_strdup (client_name); | 2999 | ret->client_name = GNUNET_strdup (client_name); |
3000 | ret->upcb = upcb; | 3000 | ret->upcb = upcb; |
diff --git a/src/fs/fs_directory.c b/src/fs/fs_directory.c index b26ec12d3..3f7cc45c1 100644 --- a/src/fs/fs_directory.c +++ b/src/fs/fs_directory.c | |||
@@ -346,7 +346,7 @@ GNUNET_FS_directory_builder_create (const struct GNUNET_CONTAINER_MetaData | |||
346 | { | 346 | { |
347 | struct GNUNET_FS_DirectoryBuilder *ret; | 347 | struct GNUNET_FS_DirectoryBuilder *ret; |
348 | 348 | ||
349 | ret = GNUNET_malloc (sizeof (struct GNUNET_FS_DirectoryBuilder)); | 349 | ret = GNUNET_new (struct GNUNET_FS_DirectoryBuilder); |
350 | if (mdir != NULL) | 350 | if (mdir != NULL) |
351 | ret->meta = GNUNET_CONTAINER_meta_data_duplicate (mdir); | 351 | ret->meta = GNUNET_CONTAINER_meta_data_duplicate (mdir); |
352 | else | 352 | else |
diff --git a/src/fs/fs_dirmetascan.c b/src/fs/fs_dirmetascan.c index 3b3615f65..83e436b16 100644 --- a/src/fs/fs_dirmetascan.c +++ b/src/fs/fs_dirmetascan.c | |||
@@ -463,7 +463,7 @@ GNUNET_FS_directory_scan_start (const char *filename, | |||
463 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 463 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
464 | "Starting to scan directory `%s'\n", | 464 | "Starting to scan directory `%s'\n", |
465 | filename_expanded); | 465 | filename_expanded); |
466 | ds = GNUNET_malloc (sizeof (struct GNUNET_FS_DirScanner)); | 466 | ds = GNUNET_new (struct GNUNET_FS_DirScanner); |
467 | ds->progress_callback = cb; | 467 | ds->progress_callback = cb; |
468 | ds->progress_callback_cls = cb_cls; | 468 | ds->progress_callback_cls = cb_cls; |
469 | ds->filename_expanded = filename_expanded; | 469 | ds->filename_expanded = filename_expanded; |
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c index f9f5c0a06..5d4c6d899 100644 --- a/src/fs/fs_download.c +++ b/src/fs/fs_download.c | |||
@@ -1550,7 +1550,7 @@ create_download_request (struct DownloadRequest *parent, | |||
1550 | unsigned int head_skip; | 1550 | unsigned int head_skip; |
1551 | uint64_t child_block_size; | 1551 | uint64_t child_block_size; |
1552 | 1552 | ||
1553 | dr = GNUNET_malloc (sizeof (struct DownloadRequest)); | 1553 | dr = GNUNET_new (struct DownloadRequest); |
1554 | dr->parent = parent; | 1554 | dr->parent = parent; |
1555 | dr->depth = depth; | 1555 | dr->depth = depth; |
1556 | dr->offset = dr_offset; | 1556 | dr->offset = dr_offset; |
diff --git a/src/fs/fs_file_information.c b/src/fs/fs_file_information.c index 87d618b07..d369598ef 100644 --- a/src/fs/fs_file_information.c +++ b/src/fs/fs_file_information.c | |||
@@ -241,7 +241,7 @@ GNUNET_FS_file_information_create_from_reader (struct GNUNET_FS_Handle *h, | |||
241 | GNUNET_break (0); | 241 | GNUNET_break (0); |
242 | return NULL; | 242 | return NULL; |
243 | } | 243 | } |
244 | ret = GNUNET_malloc (sizeof (struct GNUNET_FS_FileInformation)); | 244 | ret = GNUNET_new (struct GNUNET_FS_FileInformation); |
245 | ret->h = h; | 245 | ret->h = h; |
246 | ret->client_info = client_info; | 246 | ret->client_info = client_info; |
247 | ret->meta = GNUNET_CONTAINER_meta_data_duplicate (meta); | 247 | ret->meta = GNUNET_CONTAINER_meta_data_duplicate (meta); |
@@ -297,7 +297,7 @@ GNUNET_FS_file_information_create_empty_directory (struct GNUNET_FS_Handle *h, | |||
297 | { | 297 | { |
298 | struct GNUNET_FS_FileInformation *ret; | 298 | struct GNUNET_FS_FileInformation *ret; |
299 | 299 | ||
300 | ret = GNUNET_malloc (sizeof (struct GNUNET_FS_FileInformation)); | 300 | ret = GNUNET_new (struct GNUNET_FS_FileInformation); |
301 | ret->h = h; | 301 | ret->h = h; |
302 | ret->client_info = client_info; | 302 | ret->client_info = client_info; |
303 | ret->meta = GNUNET_CONTAINER_meta_data_duplicate (meta); | 303 | ret->meta = GNUNET_CONTAINER_meta_data_duplicate (meta); |
diff --git a/src/fs/fs_getopt.c b/src/fs/fs_getopt.c index d7ff97c6b..5e9510956 100644 --- a/src/fs/fs_getopt.c +++ b/src/fs/fs_getopt.c | |||
@@ -53,7 +53,7 @@ GNUNET_FS_getopt_set_keywords (struct GNUNET_GETOPT_CommandLineProcessorContext | |||
53 | 53 | ||
54 | if (u == NULL) | 54 | if (u == NULL) |
55 | { | 55 | { |
56 | u = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri)); | 56 | u = GNUNET_new (struct GNUNET_FS_Uri); |
57 | *uri = u; | 57 | *uri = u; |
58 | u->type = GNUNET_FS_URI_KSK; | 58 | u->type = GNUNET_FS_URI_KSK; |
59 | u->data.ksk.keywordCount = 0; | 59 | u->data.ksk.keywordCount = 0; |
diff --git a/src/fs/fs_list_indexed.c b/src/fs/fs_list_indexed.c index ef03dee76..7a891155e 100644 --- a/src/fs/fs_list_indexed.c +++ b/src/fs/fs_list_indexed.c | |||
@@ -151,7 +151,7 @@ GNUNET_FS_get_indexed_files (struct GNUNET_FS_Handle *h, | |||
151 | _("Failed to not connect to `%s' service.\n"), "fs"); | 151 | _("Failed to not connect to `%s' service.\n"), "fs"); |
152 | return NULL; | 152 | return NULL; |
153 | } | 153 | } |
154 | gic = GNUNET_malloc (sizeof (struct GNUNET_FS_GetIndexedContext)); | 154 | gic = GNUNET_new (struct GNUNET_FS_GetIndexedContext); |
155 | gic->h = h; | 155 | gic->h = h; |
156 | gic->client = client; | 156 | gic->client = client; |
157 | gic->iterator = iterator; | 157 | gic->iterator = iterator; |
diff --git a/src/fs/fs_test_lib.c b/src/fs/fs_test_lib.c index 085ea3764..1e098bd60 100644 --- a/src/fs/fs_test_lib.c +++ b/src/fs/fs_test_lib.c | |||
@@ -452,7 +452,7 @@ GNUNET_FS_TEST_publish (struct GNUNET_TESTBED_Peer *peer, | |||
452 | { | 452 | { |
453 | struct TestPublishOperation *po; | 453 | struct TestPublishOperation *po; |
454 | 454 | ||
455 | po = GNUNET_malloc (sizeof (struct TestPublishOperation)); | 455 | po = GNUNET_new (struct TestPublishOperation); |
456 | po->publish_cont = cont; | 456 | po->publish_cont = cont; |
457 | po->publish_cont_cls = cont_cls; | 457 | po->publish_cont_cls = cont_cls; |
458 | po->publish_seed = seed; | 458 | po->publish_seed = seed; |
@@ -631,7 +631,7 @@ GNUNET_FS_TEST_download (struct GNUNET_TESTBED_Peer *peer, | |||
631 | { | 631 | { |
632 | struct TestDownloadOperation *dop; | 632 | struct TestDownloadOperation *dop; |
633 | 633 | ||
634 | dop = GNUNET_malloc (sizeof (struct TestDownloadOperation)); | 634 | dop = GNUNET_new (struct TestDownloadOperation); |
635 | dop->uri = GNUNET_FS_uri_dup (uri); | 635 | dop->uri = GNUNET_FS_uri_dup (uri); |
636 | dop->size = GNUNET_FS_uri_chk_get_file_size (uri); | 636 | dop->size = GNUNET_FS_uri_chk_get_file_size (uri); |
637 | dop->verbose = verbose; | 637 | dop->verbose = verbose; |
diff --git a/src/fs/fs_tree.c b/src/fs/fs_tree.c index 4e0ef8c5b..5dc39e4e6 100644 --- a/src/fs/fs_tree.c +++ b/src/fs/fs_tree.c | |||
@@ -276,7 +276,7 @@ GNUNET_FS_tree_encoder_create (struct GNUNET_FS_Handle *h, uint64_t size, | |||
276 | { | 276 | { |
277 | struct GNUNET_FS_TreeEncoder *te; | 277 | struct GNUNET_FS_TreeEncoder *te; |
278 | 278 | ||
279 | te = GNUNET_malloc (sizeof (struct GNUNET_FS_TreeEncoder)); | 279 | te = GNUNET_new (struct GNUNET_FS_TreeEncoder); |
280 | te->h = h; | 280 | te->h = h; |
281 | te->size = size; | 281 | te->size = size; |
282 | te->cls = cls; | 282 | te->cls = cls; |
@@ -347,7 +347,7 @@ GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder *te) | |||
347 | off = CHK_PER_INODE * (te->chk_tree_depth - 1); | 347 | off = CHK_PER_INODE * (te->chk_tree_depth - 1); |
348 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "TE done, reading CHK `%s' from %u\n", | 348 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "TE done, reading CHK `%s' from %u\n", |
349 | GNUNET_h2s (&te->chk_tree[off].query), off); | 349 | GNUNET_h2s (&te->chk_tree[off].query), off); |
350 | te->uri = GNUNET_malloc (sizeof (struct GNUNET_FS_Uri)); | 350 | te->uri = GNUNET_new (struct GNUNET_FS_Uri); |
351 | te->uri->type = GNUNET_FS_URI_CHK; | 351 | te->uri->type = GNUNET_FS_URI_CHK; |
352 | te->uri->data.chk.chk = te->chk_tree[off]; | 352 | te->uri->data.chk.chk = te->chk_tree[off]; |
353 | te->uri->data.chk.file_length = GNUNET_htonll (te->size); | 353 | te->uri->data.chk.file_length = GNUNET_htonll (te->size); |
diff --git a/src/fs/fs_unindex.c b/src/fs/fs_unindex.c index 14ab0fd69..b446bab1b 100644 --- a/src/fs/fs_unindex.c +++ b/src/fs/fs_unindex.c | |||
@@ -767,7 +767,7 @@ GNUNET_FS_unindex_start (struct GNUNET_FS_Handle *h, | |||
767 | 767 | ||
768 | if (GNUNET_OK != GNUNET_DISK_file_size (filename, &size, GNUNET_YES, GNUNET_YES)) | 768 | if (GNUNET_OK != GNUNET_DISK_file_size (filename, &size, GNUNET_YES, GNUNET_YES)) |
769 | return NULL; | 769 | return NULL; |
770 | ret = GNUNET_malloc (sizeof (struct GNUNET_FS_UnindexContext)); | 770 | ret = GNUNET_new (struct GNUNET_FS_UnindexContext); |
771 | ret->h = h; | 771 | ret->h = h; |
772 | ret->filename = GNUNET_strdup (filename); | 772 | ret->filename = GNUNET_strdup (filename); |
773 | ret->start_time = GNUNET_TIME_absolute_get (); | 773 | ret->start_time = GNUNET_TIME_absolute_get (); |
diff --git a/src/fs/gnunet-auto-share.c b/src/fs/gnunet-auto-share.c index b001cb58c..2106d67f1 100644 --- a/src/fs/gnunet-auto-share.c +++ b/src/fs/gnunet-auto-share.c | |||
@@ -208,7 +208,7 @@ load_state () | |||
208 | (GNUNET_OK != | 208 | (GNUNET_OK != |
209 | GNUNET_BIO_read (rh, "id", &id, sizeof (struct GNUNET_HashCode))) ) | 209 | GNUNET_BIO_read (rh, "id", &id, sizeof (struct GNUNET_HashCode))) ) |
210 | goto error; | 210 | goto error; |
211 | wi = GNUNET_malloc (sizeof (struct WorkItem)); | 211 | wi = GNUNET_new (struct WorkItem); |
212 | wi->id = id; | 212 | wi->id = id; |
213 | wi->filename = fn; | 213 | wi->filename = fn; |
214 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 214 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -605,7 +605,7 @@ add_file (void *cls, | |||
605 | } | 605 | } |
606 | else | 606 | else |
607 | { | 607 | { |
608 | wi = GNUNET_malloc (sizeof (struct WorkItem)); | 608 | wi = GNUNET_new (struct WorkItem); |
609 | wi->filename = GNUNET_strdup (filename); | 609 | wi->filename = GNUNET_strdup (filename); |
610 | } | 610 | } |
611 | wi->id = id; | 611 | wi->id = id; |
diff --git a/src/fs/gnunet-helper-fs-publish.c b/src/fs/gnunet-helper-fs-publish.c index 214650b0f..c64dece42 100644 --- a/src/fs/gnunet-helper-fs-publish.c +++ b/src/fs/gnunet-helper-fs-publish.c | |||
@@ -328,7 +328,7 @@ preprocess_file (const char *filename, | |||
328 | : GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_PROGRESS_FILE, | 328 | : GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_PROGRESS_FILE, |
329 | filename, strlen (filename) + 1)) | 329 | filename, strlen (filename) + 1)) |
330 | return GNUNET_SYSERR; | 330 | return GNUNET_SYSERR; |
331 | item = GNUNET_malloc (sizeof (struct ScanTreeNode)); | 331 | item = GNUNET_new (struct ScanTreeNode); |
332 | item->filename = GNUNET_strdup (filename); | 332 | item->filename = GNUNET_strdup (filename); |
333 | item->is_directory = (S_ISDIR (sbuf.st_mode)) ? GNUNET_YES : GNUNET_NO; | 333 | item->is_directory = (S_ISDIR (sbuf.st_mode)) ? GNUNET_YES : GNUNET_NO; |
334 | item->file_size = fsize; | 334 | item->file_size = fsize; |
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c index e3ce8dd69..0af19d537 100644 --- a/src/fs/gnunet-service-fs_pr.c +++ b/src/fs/gnunet-service-fs_pr.c | |||
@@ -1078,7 +1078,7 @@ handle_dht_reply (void *cls, struct GNUNET_TIME_Absolute exp, | |||
1078 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1078 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1079 | "Replicating result for query `%s' with priority %u\n", | 1079 | "Replicating result for query `%s' with priority %u\n", |
1080 | GNUNET_h2s (key), prq.priority); | 1080 | GNUNET_h2s (key), prq.priority); |
1081 | pmc = GNUNET_malloc (sizeof (struct PutMigrationContext)); | 1081 | pmc = GNUNET_new (struct PutMigrationContext); |
1082 | pmc->start = GNUNET_TIME_absolute_get (); | 1082 | pmc->start = GNUNET_TIME_absolute_get (); |
1083 | pmc->requested = GNUNET_YES; | 1083 | pmc->requested = GNUNET_YES; |
1084 | if (NULL == | 1084 | if (NULL == |
@@ -1675,7 +1675,7 @@ GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp, | |||
1675 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1675 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1676 | "Replicating result for query `%s' with priority %u\n", | 1676 | "Replicating result for query `%s' with priority %u\n", |
1677 | GNUNET_h2s (&query), prq.priority); | 1677 | GNUNET_h2s (&query), prq.priority); |
1678 | pmc = GNUNET_malloc (sizeof (struct PutMigrationContext)); | 1678 | pmc = GNUNET_new (struct PutMigrationContext); |
1679 | pmc->start = GNUNET_TIME_absolute_get (); | 1679 | pmc->start = GNUNET_TIME_absolute_get (); |
1680 | pmc->requested = prq.request_found; | 1680 | pmc->requested = prq.request_found; |
1681 | GNUNET_assert (0 != GSF_get_peer_performance_data_ (cp)->pid); | 1681 | GNUNET_assert (0 != GSF_get_peer_performance_data_ (cp)->pid); |
diff --git a/src/fs/perf_gnunet_service_fs_p2p.c b/src/fs/perf_gnunet_service_fs_p2p.c index 2462bb3f2..17a27f803 100644 --- a/src/fs/perf_gnunet_service_fs_p2p.c +++ b/src/fs/perf_gnunet_service_fs_p2p.c | |||
@@ -263,7 +263,7 @@ do_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
263 | GNUNET_free (fancy); | 263 | GNUNET_free (fancy); |
264 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Finished download, shutting down\n", | 264 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Finished download, shutting down\n", |
265 | (unsigned long long) FILESIZE); | 265 | (unsigned long long) FILESIZE); |
266 | sm = GNUNET_malloc (sizeof (struct StatMaster)); | 266 | sm = GNUNET_new (struct StatMaster); |
267 | sm->op = | 267 | sm->op = |
268 | GNUNET_TESTBED_service_connect (NULL, | 268 | GNUNET_TESTBED_service_connect (NULL, |
269 | daemons[sm->daemon], | 269 | daemons[sm->daemon], |
diff --git a/src/fs/perf_gnunet_service_fs_p2p_respect.c b/src/fs/perf_gnunet_service_fs_p2p_respect.c index b2471a8b4..4d6de9a90 100644 --- a/src/fs/perf_gnunet_service_fs_p2p_respect.c +++ b/src/fs/perf_gnunet_service_fs_p2p_respect.c | |||
@@ -308,7 +308,7 @@ do_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
308 | return; /* more downloads to come */ | 308 | return; /* more downloads to come */ |
309 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 309 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
310 | "Finished all downloads, getting statistics\n"); | 310 | "Finished all downloads, getting statistics\n"); |
311 | sm = GNUNET_malloc (sizeof (struct StatMaster)); | 311 | sm = GNUNET_new (struct StatMaster); |
312 | sm->op = | 312 | sm->op = |
313 | GNUNET_TESTBED_service_connect (NULL, | 313 | GNUNET_TESTBED_service_connect (NULL, |
314 | daemons[sm->daemon], | 314 | daemons[sm->daemon], |
diff --git a/src/fs/test_gnunet_service_fs_migration.c b/src/fs/test_gnunet_service_fs_migration.c index 770c212ba..4defe119b 100644 --- a/src/fs/test_gnunet_service_fs_migration.c +++ b/src/fs/test_gnunet_service_fs_migration.c | |||
@@ -151,7 +151,7 @@ do_wait (void *cls, const struct GNUNET_FS_Uri *uri, | |||
151 | return; | 151 | return; |
152 | } | 152 | } |
153 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Waiting to allow content to migrate\n"); | 153 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Waiting to allow content to migrate\n"); |
154 | dc = GNUNET_malloc (sizeof (struct DownloadContext)); | 154 | dc = GNUNET_new (struct DownloadContext); |
155 | dc->uri = GNUNET_FS_uri_dup (uri); | 155 | dc->uri = GNUNET_FS_uri_dup (uri); |
156 | if (NULL != fn) | 156 | if (NULL != fn) |
157 | dc->fn = GNUNET_strdup (fn); | 157 | dc->fn = GNUNET_strdup (fn); |
diff --git a/src/gns/gnunet-dns2gns.c b/src/gns/gnunet-dns2gns.c index 3d55bc045..a19a97cf3 100644 --- a/src/gns/gnunet-dns2gns.c +++ b/src/gns/gnunet-dns2gns.c | |||
@@ -338,7 +338,7 @@ result_processor (void *cls, | |||
338 | case GNUNET_DNSPARSER_TYPE_AAAA: | 338 | case GNUNET_DNSPARSER_TYPE_AAAA: |
339 | GNUNET_assert (sizeof (struct in6_addr) == rd[i].data_size); | 339 | GNUNET_assert (sizeof (struct in6_addr) == rd[i].data_size); |
340 | rec.name = GNUNET_strdup (packet->queries[0].name); | 340 | rec.name = GNUNET_strdup (packet->queries[0].name); |
341 | rec.data.raw.data = GNUNET_malloc (sizeof (struct in6_addr)); | 341 | rec.data.raw.data = GNUNET_new (struct in6_addr); |
342 | rec.dns_traffic_class = GNUNET_TUN_DNS_CLASS_INTERNET; | 342 | rec.dns_traffic_class = GNUNET_TUN_DNS_CLASS_INTERNET; |
343 | rec.type = GNUNET_DNSPARSER_TYPE_AAAA; | 343 | rec.type = GNUNET_DNSPARSER_TYPE_AAAA; |
344 | memcpy (rec.data.raw.data, | 344 | memcpy (rec.data.raw.data, |
diff --git a/src/gns/gnunet-gns-helper-service-w32.c b/src/gns/gnunet-gns-helper-service-w32.c index 48bbd5723..93b843697 100644 --- a/src/gns/gnunet-gns-helper-service-w32.c +++ b/src/gns/gnunet-gns-helper-service-w32.c | |||
@@ -216,7 +216,7 @@ transmit (struct GNUNET_SERVER_Client *client, | |||
216 | GNUNET_free (msg); | 216 | GNUNET_free (msg); |
217 | return; | 217 | return; |
218 | } | 218 | } |
219 | tcc = GNUNET_malloc (sizeof (struct TransmitCallbackContext)); | 219 | tcc = GNUNET_new (struct TransmitCallbackContext); |
220 | tcc->msg = msg; | 220 | tcc->msg = msg; |
221 | if (NULL == | 221 | if (NULL == |
222 | (tcc->th = | 222 | (tcc->th = |
@@ -594,7 +594,7 @@ get_ip_from_hostname (struct GNUNET_SERVER_Client *client, | |||
594 | af == AF_INET ? "IPv4" : af == AF_INET6 ? "IPv6" : "anything", | 594 | af == AF_INET ? "IPv4" : af == AF_INET6 ? "IPv6" : "anything", |
595 | hostname); | 595 | hostname); |
596 | 596 | ||
597 | rq = GNUNET_malloc (sizeof (struct request)); | 597 | rq = GNUNET_new (struct request); |
598 | rq->sc = sc; | 598 | rq->sc = sc; |
599 | rq->client = client; | 599 | rq->client = client; |
600 | rq->af = af; | 600 | rq->af = af; |
diff --git a/src/gnsrecord/plugin_gnsrecord_dns.c b/src/gnsrecord/plugin_gnsrecord_dns.c index 4f010dc42..362acbf87 100644 --- a/src/gnsrecord/plugin_gnsrecord_dns.c +++ b/src/gnsrecord/plugin_gnsrecord_dns.c | |||
@@ -294,7 +294,7 @@ dns_string_to_value (void *cls, | |||
294 | s); | 294 | s); |
295 | return GNUNET_SYSERR; | 295 | return GNUNET_SYSERR; |
296 | } | 296 | } |
297 | *data = GNUNET_malloc (sizeof (struct in_addr)); | 297 | *data = GNUNET_new (struct in_addr); |
298 | memcpy (*data, &value_a, sizeof (value_a)); | 298 | memcpy (*data, &value_a, sizeof (value_a)); |
299 | *data_size = sizeof (value_a); | 299 | *data_size = sizeof (value_a); |
300 | return GNUNET_OK; | 300 | return GNUNET_OK; |
@@ -550,7 +550,7 @@ dns_string_to_value (void *cls, | |||
550 | s); | 550 | s); |
551 | return GNUNET_SYSERR; | 551 | return GNUNET_SYSERR; |
552 | } | 552 | } |
553 | *data = GNUNET_malloc (sizeof (struct in6_addr)); | 553 | *data = GNUNET_new (struct in6_addr); |
554 | *data_size = sizeof (struct in6_addr); | 554 | *data_size = sizeof (struct in6_addr); |
555 | memcpy (*data, &value_aaaa, sizeof (value_aaaa)); | 555 | memcpy (*data, &value_aaaa, sizeof (value_aaaa)); |
556 | return GNUNET_OK; | 556 | return GNUNET_OK; |
diff --git a/src/hostlist/hostlist-server.c b/src/hostlist/hostlist-server.c index 2cda6dd00..ef4debc05 100644 --- a/src/hostlist/hostlist-server.c +++ b/src/hostlist/hostlist-server.c | |||
@@ -433,7 +433,7 @@ process_notify (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
433 | } | 433 | } |
434 | else | 434 | else |
435 | { | 435 | { |
436 | builder = GNUNET_malloc (sizeof (struct HostSet)); | 436 | builder = GNUNET_new (struct HostSet); |
437 | } | 437 | } |
438 | GNUNET_assert (NULL != peerinfo); | 438 | GNUNET_assert (NULL != peerinfo); |
439 | builder->pitr = | 439 | builder->pitr = |
diff --git a/src/mesh/gnunet-service-mesh_local.c b/src/mesh/gnunet-service-mesh_local.c index adac4cdf1..fa54fafa6 100644 --- a/src/mesh/gnunet-service-mesh_local.c +++ b/src/mesh/gnunet-service-mesh_local.c | |||
@@ -593,7 +593,7 @@ handle_ack (void *cls, struct GNUNET_SERVER_Client *client, | |||
593 | // struct MeshChannel *ch = value; | 593 | // struct MeshChannel *ch = value; |
594 | // struct GNUNET_MESH_LocalMonitor *msg; | 594 | // struct GNUNET_MESH_LocalMonitor *msg; |
595 | // | 595 | // |
596 | // msg = GNUNET_malloc (sizeof(struct GNUNET_MESH_LocalMonitor)); | 596 | // msg = GNUNET_new (struct GNUNET_MESH_LocalMonitor); |
597 | // msg->channel_id = htonl (ch->gid); | 597 | // msg->channel_id = htonl (ch->gid); |
598 | // msg->header.size = htons (sizeof (struct GNUNET_MESH_LocalMonitor)); | 598 | // msg->header.size = htons (sizeof (struct GNUNET_MESH_LocalMonitor)); |
599 | // msg->header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_INFO_TUNNELS); | 599 | // msg->header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_INFO_TUNNELS); |
@@ -688,7 +688,7 @@ handle_show_tunnel (void *cls, struct GNUNET_SERVER_Client *client, | |||
688 | } | 688 | } |
689 | 689 | ||
690 | /* Initialize context */ | 690 | /* Initialize context */ |
691 | resp = GNUNET_malloc (sizeof (struct GNUNET_MESH_LocalMonitor)); | 691 | resp = GNUNET_new (struct GNUNET_MESH_LocalMonitor); |
692 | *resp = *msg; | 692 | *resp = *msg; |
693 | resp->header.size = htons (sizeof (struct GNUNET_MESH_LocalMonitor)); | 693 | resp->header.size = htons (sizeof (struct GNUNET_MESH_LocalMonitor)); |
694 | GNUNET_SERVER_notification_context_unicast (nc, c->handle, | 694 | GNUNET_SERVER_notification_context_unicast (nc, c->handle, |
diff --git a/src/mesh/gnunet-service-mesh_peer.c b/src/mesh/gnunet-service-mesh_peer.c index 741bffc2f..def57ba56 100644 --- a/src/mesh/gnunet-service-mesh_peer.c +++ b/src/mesh/gnunet-service-mesh_peer.c | |||
@@ -1051,7 +1051,7 @@ GMP_queue_add (struct MeshPeer *peer, void *cls, uint16_t type, size_t size, | |||
1051 | LOG (GNUNET_ERROR_TYPE_DEBUG, "priority %d\n", priority); | 1051 | LOG (GNUNET_ERROR_TYPE_DEBUG, "priority %d\n", priority); |
1052 | 1052 | ||
1053 | call_core = NULL == c ? GNUNET_YES : GMC_is_sendable (c, fwd); | 1053 | call_core = NULL == c ? GNUNET_YES : GMC_is_sendable (c, fwd); |
1054 | queue = GNUNET_malloc (sizeof (struct MeshPeerQueue)); | 1054 | queue = GNUNET_new (struct MeshPeerQueue); |
1055 | queue->cls = cls; | 1055 | queue->cls = cls; |
1056 | queue->type = type; | 1056 | queue->type = type; |
1057 | queue->size = size; | 1057 | queue->size = size; |
diff --git a/src/mesh/mesh_api.c b/src/mesh/mesh_api.c index 22ef3e19b..d670f4f30 100644 --- a/src/mesh/mesh_api.c +++ b/src/mesh/mesh_api.c | |||
@@ -404,7 +404,7 @@ create_channel (struct GNUNET_MESH_Handle *h, MESH_ChannelNumber chid) | |||
404 | { | 404 | { |
405 | struct GNUNET_MESH_Channel *ch; | 405 | struct GNUNET_MESH_Channel *ch; |
406 | 406 | ||
407 | ch = GNUNET_malloc (sizeof (struct GNUNET_MESH_Channel)); | 407 | ch = GNUNET_new (struct GNUNET_MESH_Channel); |
408 | GNUNET_CONTAINER_DLL_insert (h->channels_head, h->channels_tail, ch); | 408 | GNUNET_CONTAINER_DLL_insert (h->channels_head, h->channels_tail, ch); |
409 | ch->mesh = h; | 409 | ch->mesh = h; |
410 | if (0 == chid) | 410 | if (0 == chid) |
@@ -1243,7 +1243,7 @@ GNUNET_MESH_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, void *cls, | |||
1243 | struct GNUNET_MESH_Handle *h; | 1243 | struct GNUNET_MESH_Handle *h; |
1244 | 1244 | ||
1245 | LOG (GNUNET_ERROR_TYPE_DEBUG, "GNUNET_MESH_connect()\n"); | 1245 | LOG (GNUNET_ERROR_TYPE_DEBUG, "GNUNET_MESH_connect()\n"); |
1246 | h = GNUNET_malloc (sizeof (struct GNUNET_MESH_Handle)); | 1246 | h = GNUNET_new (struct GNUNET_MESH_Handle); |
1247 | LOG (GNUNET_ERROR_TYPE_DEBUG, " addr %p\n", h); | 1247 | LOG (GNUNET_ERROR_TYPE_DEBUG, " addr %p\n", h); |
1248 | h->cfg = cfg; | 1248 | h->cfg = cfg; |
1249 | h->new_channel = new_channel; | 1249 | h->new_channel = new_channel; |
@@ -1496,7 +1496,7 @@ GNUNET_MESH_notify_transmit_ready (struct GNUNET_MESH_Channel *channel, int cork | |||
1496 | LOG (GNUNET_ERROR_TYPE_DEBUG, " payload size %u\n", notify_size); | 1496 | LOG (GNUNET_ERROR_TYPE_DEBUG, " payload size %u\n", notify_size); |
1497 | GNUNET_assert (NULL != notify); | 1497 | GNUNET_assert (NULL != notify); |
1498 | GNUNET_assert (0 == channel->packet_size); // Only one data packet allowed | 1498 | GNUNET_assert (0 == channel->packet_size); // Only one data packet allowed |
1499 | th = GNUNET_malloc (sizeof (struct GNUNET_MESH_TransmitHandle)); | 1499 | th = GNUNET_new (struct GNUNET_MESH_TransmitHandle); |
1500 | th->channel = channel; | 1500 | th->channel = channel; |
1501 | th->timeout = GNUNET_TIME_relative_to_absolute (maxdelay); | 1501 | th->timeout = GNUNET_TIME_relative_to_absolute (maxdelay); |
1502 | th->size = notify_size + sizeof (struct GNUNET_MESH_LocalData); | 1502 | th->size = notify_size + sizeof (struct GNUNET_MESH_LocalData); |
diff --git a/src/mesh/mesh_path.c b/src/mesh/mesh_path.c index f1c68c005..ad1f7f4db 100644 --- a/src/mesh/mesh_path.c +++ b/src/mesh/mesh_path.c | |||
@@ -60,7 +60,7 @@ path_new (unsigned int length) | |||
60 | { | 60 | { |
61 | struct MeshPeerPath *p; | 61 | struct MeshPeerPath *p; |
62 | 62 | ||
63 | p = GNUNET_malloc (sizeof (struct MeshPeerPath)); | 63 | p = GNUNET_new (struct MeshPeerPath); |
64 | if (length > 0) | 64 | if (length > 0) |
65 | { | 65 | { |
66 | p->length = length; | 66 | p->length = length; |
diff --git a/src/mesh/mesh_test_lib.c b/src/mesh/mesh_test_lib.c index 7ad888da8..0229a5bb1 100644 --- a/src/mesh/mesh_test_lib.c +++ b/src/mesh/mesh_test_lib.c | |||
@@ -237,7 +237,7 @@ mesh_test_run (void *cls, | |||
237 | for (i = 0; i < num_peers; i++) | 237 | for (i = 0; i < num_peers; i++) |
238 | { | 238 | { |
239 | struct GNUNET_MESH_TEST_AdapterContext *newctx; | 239 | struct GNUNET_MESH_TEST_AdapterContext *newctx; |
240 | newctx = GNUNET_malloc (sizeof (struct GNUNET_MESH_TEST_AdapterContext)); | 240 | newctx = GNUNET_new (struct GNUNET_MESH_TEST_AdapterContext); |
241 | newctx->peer = i; | 241 | newctx->peer = i; |
242 | newctx->ctx = ctx; | 242 | newctx->ctx = ctx; |
243 | ctx->ops[i] = GNUNET_TESTBED_service_connect (ctx, | 243 | ctx->ops[i] = GNUNET_TESTBED_service_connect (ctx, |
@@ -265,7 +265,7 @@ GNUNET_MESH_TEST_run (const char *testname, | |||
265 | { | 265 | { |
266 | struct GNUNET_MESH_TEST_Context *ctx; | 266 | struct GNUNET_MESH_TEST_Context *ctx; |
267 | 267 | ||
268 | ctx = GNUNET_malloc (sizeof (struct GNUNET_MESH_TEST_Context)); | 268 | ctx = GNUNET_new (struct GNUNET_MESH_TEST_Context); |
269 | ctx->num_peers = num_peers; | 269 | ctx->num_peers = num_peers; |
270 | ctx->ops = GNUNET_malloc (num_peers * sizeof (struct GNUNET_TESTBED_Operation *)); | 270 | ctx->ops = GNUNET_malloc (num_peers * sizeof (struct GNUNET_TESTBED_Operation *)); |
271 | ctx->meshes = GNUNET_malloc (num_peers * sizeof (struct GNUNET_MESH_Handle *)); | 271 | ctx->meshes = GNUNET_malloc (num_peers * sizeof (struct GNUNET_MESH_Handle *)); |
diff --git a/src/mesh/mesh_tunnel_tree.c b/src/mesh/mesh_tunnel_tree.c index c2fe6c3d9..48d052ef7 100644 --- a/src/mesh/mesh_tunnel_tree.c +++ b/src/mesh/mesh_tunnel_tree.c | |||
@@ -119,7 +119,7 @@ path_new (unsigned int length) | |||
119 | { | 119 | { |
120 | struct MeshPeerPath *p; | 120 | struct MeshPeerPath *p; |
121 | 121 | ||
122 | p = GNUNET_malloc (sizeof (struct MeshPeerPath)); | 122 | p = GNUNET_new (struct MeshPeerPath); |
123 | if (length > 0) | 123 | if (length > 0) |
124 | { | 124 | { |
125 | p->length = length; | 125 | p->length = length; |
@@ -233,7 +233,7 @@ tree_node_new (struct MeshTunnelTreeNode *parent, GNUNET_PEER_Id peer) | |||
233 | { | 233 | { |
234 | struct MeshTunnelTreeNode *node; | 234 | struct MeshTunnelTreeNode *node; |
235 | 235 | ||
236 | node = GNUNET_malloc (sizeof (struct MeshTunnelTreeNode)); | 236 | node = GNUNET_new (struct MeshTunnelTreeNode); |
237 | node->peer = peer; | 237 | node->peer = peer; |
238 | GNUNET_PEER_change_rc (peer, 1); | 238 | GNUNET_PEER_change_rc (peer, 1); |
239 | node->parent = parent; | 239 | node->parent = parent; |
@@ -322,7 +322,7 @@ tree_node_update_first_hops (struct MeshTunnelTree *tree, | |||
322 | GNUNET_PEER_resolve (parent->peer, &id); | 322 | GNUNET_PEER_resolve (parent->peer, &id); |
323 | copy = GNUNET_CONTAINER_multihashmap_get (tree->first_hops, &id.hashPubKey); | 323 | copy = GNUNET_CONTAINER_multihashmap_get (tree->first_hops, &id.hashPubKey); |
324 | if (NULL == copy) | 324 | if (NULL == copy) |
325 | copy = GNUNET_malloc (sizeof (struct GNUNET_PeerIdentity)); | 325 | copy = GNUNET_new (struct GNUNET_PeerIdentity); |
326 | *copy = *hop; | 326 | *copy = *hop; |
327 | 327 | ||
328 | (void) GNUNET_CONTAINER_multihashmap_put (tree->first_hops, &id.hashPubKey, | 328 | (void) GNUNET_CONTAINER_multihashmap_put (tree->first_hops, &id.hashPubKey, |
@@ -417,7 +417,7 @@ tree_new (GNUNET_PEER_Id peer) | |||
417 | { | 417 | { |
418 | struct MeshTunnelTree *tree; | 418 | struct MeshTunnelTree *tree; |
419 | 419 | ||
420 | tree = GNUNET_malloc (sizeof (struct MeshTunnelTree)); | 420 | tree = GNUNET_new (struct MeshTunnelTree); |
421 | tree->first_hops = GNUNET_CONTAINER_multihashmap_create (32, GNUNET_NO); | 421 | tree->first_hops = GNUNET_CONTAINER_multihashmap_create (32, GNUNET_NO); |
422 | tree->root = tree_node_new (NULL, peer); | 422 | tree->root = tree_node_new (NULL, peer); |
423 | tree->root->status = MESH_PEER_ROOT; | 423 | tree->root->status = MESH_PEER_ROOT; |
@@ -647,7 +647,7 @@ tree_iterate_all (struct MeshTunnelTree *tree, | |||
647 | struct MeshTreePendingNode *pending; | 647 | struct MeshTreePendingNode *pending; |
648 | 648 | ||
649 | cb (cb_cls, tree->root->peer, 0); | 649 | cb (cb_cls, tree->root->peer, 0); |
650 | pending = GNUNET_malloc (sizeof (struct MeshTreePendingNode)); | 650 | pending = GNUNET_new (struct MeshTreePendingNode); |
651 | pending->node = tree->root; | 651 | pending->node = tree->root; |
652 | head = tail = NULL; | 652 | head = tail = NULL; |
653 | GNUNET_CONTAINER_DLL_insert (head, tail, pending); | 653 | GNUNET_CONTAINER_DLL_insert (head, tail, pending); |
@@ -661,7 +661,7 @@ tree_iterate_all (struct MeshTunnelTree *tree, | |||
661 | for (n = parent->children_head; NULL != n; n = n->next) | 661 | for (n = parent->children_head; NULL != n; n = n->next) |
662 | { | 662 | { |
663 | cb (cb_cls, n->peer, parent->peer); | 663 | cb (cb_cls, n->peer, parent->peer); |
664 | pending = GNUNET_malloc (sizeof (struct MeshTreePendingNode)); | 664 | pending = GNUNET_new (struct MeshTreePendingNode); |
665 | pending->node = n; | 665 | pending->node = n; |
666 | /* Insert_tail: breadth first, Insert: depth first */ | 666 | /* Insert_tail: breadth first, Insert: depth first */ |
667 | GNUNET_CONTAINER_DLL_insert (head, tail, pending); | 667 | GNUNET_CONTAINER_DLL_insert (head, tail, pending); |
diff --git a/src/mysql/mysql.c b/src/mysql/mysql.c index 098213b33..22804d474 100644 --- a/src/mysql/mysql.c +++ b/src/mysql/mysql.c | |||
@@ -292,7 +292,7 @@ GNUNET_MYSQL_context_create (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
292 | { | 292 | { |
293 | struct GNUNET_MYSQL_Context *mc; | 293 | struct GNUNET_MYSQL_Context *mc; |
294 | 294 | ||
295 | mc = GNUNET_malloc (sizeof (struct GNUNET_MYSQL_Context)); | 295 | mc = GNUNET_new (struct GNUNET_MYSQL_Context); |
296 | mc->cfg = cfg; | 296 | mc->cfg = cfg; |
297 | mc->section = section; | 297 | mc->section = section; |
298 | mc->cnffile = get_my_cnf_path (cfg, section); | 298 | mc->cnffile = get_my_cnf_path (cfg, section); |
@@ -365,7 +365,7 @@ GNUNET_MYSQL_statement_prepare (struct GNUNET_MYSQL_Context *mc, | |||
365 | { | 365 | { |
366 | struct GNUNET_MYSQL_StatementHandle *sh; | 366 | struct GNUNET_MYSQL_StatementHandle *sh; |
367 | 367 | ||
368 | sh = GNUNET_malloc (sizeof (struct GNUNET_MYSQL_StatementHandle)); | 368 | sh = GNUNET_new (struct GNUNET_MYSQL_StatementHandle); |
369 | sh->query = GNUNET_strdup (query); | 369 | sh->query = GNUNET_strdup (query); |
370 | GNUNET_CONTAINER_DLL_insert (mc->shead, mc->stail, sh); | 370 | GNUNET_CONTAINER_DLL_insert (mc->shead, mc->stail, sh); |
371 | return sh; | 371 | return sh; |
diff --git a/src/namestore/gnunet-namestore-fcfsd.c b/src/namestore/gnunet-namestore-fcfsd.c index b3e42f818..d19a38ce9 100644 --- a/src/namestore/gnunet-namestore-fcfsd.c +++ b/src/namestore/gnunet-namestore-fcfsd.c | |||
@@ -658,7 +658,7 @@ create_response (void *cls, | |||
658 | request = *ptr; | 658 | request = *ptr; |
659 | if (NULL == request) | 659 | if (NULL == request) |
660 | { | 660 | { |
661 | request = GNUNET_malloc (sizeof (struct Request)); | 661 | request = GNUNET_new (struct Request); |
662 | *ptr = request; | 662 | *ptr = request; |
663 | request->pp = MHD_create_post_processor (connection, 1024, | 663 | request->pp = MHD_create_post_processor (connection, 1024, |
664 | &post_iterator, request); | 664 | &post_iterator, request); |
diff --git a/src/nat/gnunet-nat-server.c b/src/nat/gnunet-nat-server.c index 1a98cdc96..82e39ee16 100644 --- a/src/nat/gnunet-nat-server.c +++ b/src/nat/gnunet-nat-server.c | |||
@@ -152,7 +152,7 @@ try_send_tcp (uint32_t dst_ipv4, uint16_t dport, uint16_t data) | |||
152 | GNUNET_NETWORK_socket_close (s); | 152 | GNUNET_NETWORK_socket_close (s); |
153 | return; | 153 | return; |
154 | } | 154 | } |
155 | ctx = GNUNET_malloc (sizeof (struct TcpContext)); | 155 | ctx = GNUNET_new (struct TcpContext); |
156 | ctx->s = s; | 156 | ctx->s = s; |
157 | ctx->data = data; | 157 | ctx->data = data; |
158 | GNUNET_SCHEDULER_add_write_net (GNUNET_TIME_UNIT_SECONDS, s, &tcp_send, ctx); | 158 | GNUNET_SCHEDULER_add_write_net (GNUNET_TIME_UNIT_SECONDS, s, &tcp_send, ctx); |
diff --git a/src/nat/nat_mini.c b/src/nat/nat_mini.c index dd1aede5e..497371e86 100644 --- a/src/nat/nat_mini.c +++ b/src/nat/nat_mini.c | |||
@@ -172,7 +172,7 @@ GNUNET_NAT_mini_get_external_ipv4 (struct GNUNET_TIME_Relative timeout, | |||
172 | } | 172 | } |
173 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 173 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
174 | "Running `external-ip' to determine our external IP\n"); | 174 | "Running `external-ip' to determine our external IP\n"); |
175 | eh = GNUNET_malloc (sizeof (struct GNUNET_NAT_ExternalHandle)); | 175 | eh = GNUNET_new (struct GNUNET_NAT_ExternalHandle); |
176 | eh->cb = cb; | 176 | eh->cb = cb; |
177 | eh->cb_cls = cb_cls; | 177 | eh->cb_cls = cb_cls; |
178 | eh->opipe = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_NO, GNUNET_YES); | 178 | eh->opipe = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_NO, GNUNET_YES); |
@@ -507,7 +507,7 @@ GNUNET_NAT_mini_map_start (uint16_t port, int is_tcp, | |||
507 | } | 507 | } |
508 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 508 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
509 | "Running `upnpc' to install mapping\n"); | 509 | "Running `upnpc' to install mapping\n"); |
510 | ret = GNUNET_malloc (sizeof (struct GNUNET_NAT_MiniHandle)); | 510 | ret = GNUNET_new (struct GNUNET_NAT_MiniHandle); |
511 | ret->ac = ac; | 511 | ret->ac = ac; |
512 | ret->ac_cls = ac_cls; | 512 | ret->ac_cls = ac_cls; |
513 | ret->is_tcp = is_tcp; | 513 | ret->is_tcp = is_tcp; |
diff --git a/src/nse/gnunet-nse-profiler.c b/src/nse/gnunet-nse-profiler.c index 2dbca7541..3e39056be 100644 --- a/src/nse/gnunet-nse-profiler.c +++ b/src/nse/gnunet-nse-profiler.c | |||
@@ -511,7 +511,7 @@ connect_nse_service () | |||
511 | (0 != (i % (num_peers_in_round[current_round] / connection_limit)))) | 511 | (0 != (i % (num_peers_in_round[current_round] / connection_limit)))) |
512 | continue; | 512 | continue; |
513 | LOG_DEBUG ("Connecting to nse service of peer %d\n", i); | 513 | LOG_DEBUG ("Connecting to nse service of peer %d\n", i); |
514 | current_peer = GNUNET_malloc (sizeof (struct NSEPeer)); | 514 | current_peer = GNUNET_new (struct NSEPeer); |
515 | current_peer->daemon = daemons[i]; | 515 | current_peer->daemon = daemons[i]; |
516 | current_peer->nse_op | 516 | current_peer->nse_op |
517 | = GNUNET_TESTBED_service_connect (NULL, | 517 | = GNUNET_TESTBED_service_connect (NULL, |
@@ -593,7 +593,7 @@ make_oplist_entry () | |||
593 | { | 593 | { |
594 | struct OpListEntry *entry; | 594 | struct OpListEntry *entry; |
595 | 595 | ||
596 | entry = GNUNET_malloc (sizeof (struct OpListEntry)); | 596 | entry = GNUNET_new (struct OpListEntry); |
597 | GNUNET_CONTAINER_DLL_insert_tail (oplist_head, oplist_tail, entry); | 597 | GNUNET_CONTAINER_DLL_insert_tail (oplist_head, oplist_tail, entry); |
598 | return entry; | 598 | return entry; |
599 | } | 599 | } |
diff --git a/src/peerinfo-tool/gnunet-peerinfo.c b/src/peerinfo-tool/gnunet-peerinfo.c index e62df3047..f4a9d3aa6 100644 --- a/src/peerinfo-tool/gnunet-peerinfo.c +++ b/src/peerinfo-tool/gnunet-peerinfo.c | |||
@@ -364,7 +364,7 @@ print_peer_info (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
364 | GNUNET_i2s_full (peer)); | 364 | GNUNET_i2s_full (peer)); |
365 | return; | 365 | return; |
366 | } | 366 | } |
367 | pc = GNUNET_malloc (sizeof (struct PrintContext)); | 367 | pc = GNUNET_new (struct PrintContext); |
368 | GNUNET_CONTAINER_DLL_insert (pc_head, | 368 | GNUNET_CONTAINER_DLL_insert (pc_head, |
369 | pc_tail, | 369 | pc_tail, |
370 | pc); | 370 | pc); |
diff --git a/src/peerinfo-tool/gnunet-peerinfo_plugins.c b/src/peerinfo-tool/gnunet-peerinfo_plugins.c index 29dc4d017..37553f2f7 100644 --- a/src/peerinfo-tool/gnunet-peerinfo_plugins.c +++ b/src/peerinfo-tool/gnunet-peerinfo_plugins.c | |||
@@ -109,7 +109,7 @@ GPI_plugins_load (const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
109 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Loading `%s' transport plugin\n"), | 109 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Loading `%s' transport plugin\n"), |
110 | pos); | 110 | pos); |
111 | GNUNET_asprintf (&libname, "libgnunet_plugin_transport_%s", pos); | 111 | GNUNET_asprintf (&libname, "libgnunet_plugin_transport_%s", pos); |
112 | plug = GNUNET_malloc (sizeof (struct TransportPlugin)); | 112 | plug = GNUNET_new (struct TransportPlugin); |
113 | plug->short_name = GNUNET_strdup (pos); | 113 | plug->short_name = GNUNET_strdup (pos); |
114 | plug->lib_name = libname; | 114 | plug->lib_name = libname; |
115 | plug->env.cfg = cfg; | 115 | plug->env.cfg = cfg; |
diff --git a/src/peerinfo/gnunet-service-peerinfo.c b/src/peerinfo/gnunet-service-peerinfo.c index a78855101..60ecaeb41 100644 --- a/src/peerinfo/gnunet-service-peerinfo.c +++ b/src/peerinfo/gnunet-service-peerinfo.c | |||
@@ -1138,7 +1138,7 @@ handle_notify (void *cls, struct GNUNET_SERVER_Client *client, | |||
1138 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1138 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1139 | "`%s' message received\n", | 1139 | "`%s' message received\n", |
1140 | "NOTIFY"); | 1140 | "NOTIFY"); |
1141 | nc = GNUNET_malloc (sizeof (struct NotificationContext)); | 1141 | nc = GNUNET_new (struct NotificationContext); |
1142 | nc->client = client; | 1142 | nc->client = client; |
1143 | nc->include_friend_only = ntohl (nm->include_friend_only); | 1143 | nc->include_friend_only = ntohl (nm->include_friend_only); |
1144 | 1144 | ||
diff --git a/src/peerinfo/peerinfo_api.c b/src/peerinfo/peerinfo_api.c index 794060487..716802389 100644 --- a/src/peerinfo/peerinfo_api.c +++ b/src/peerinfo/peerinfo_api.c | |||
@@ -201,7 +201,7 @@ GNUNET_PEERINFO_connect (const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
201 | { | 201 | { |
202 | struct GNUNET_PEERINFO_Handle *h; | 202 | struct GNUNET_PEERINFO_Handle *h; |
203 | 203 | ||
204 | h = GNUNET_malloc (sizeof (struct GNUNET_PEERINFO_Handle)); | 204 | h = GNUNET_new (struct GNUNET_PEERINFO_Handle); |
205 | h->client = GNUNET_CLIENT_connect ("peerinfo", cfg); | 205 | h->client = GNUNET_CLIENT_connect ("peerinfo", cfg); |
206 | h->cfg = cfg; | 206 | h->cfg = cfg; |
207 | return h; | 207 | return h; |
@@ -708,7 +708,7 @@ GNUNET_PEERINFO_iterate (struct GNUNET_PEERINFO_Handle *h, | |||
708 | struct GNUNET_PEERINFO_IteratorContext *ic; | 708 | struct GNUNET_PEERINFO_IteratorContext *ic; |
709 | struct GNUNET_PEERINFO_AddContext *ac; | 709 | struct GNUNET_PEERINFO_AddContext *ac; |
710 | 710 | ||
711 | ic = GNUNET_malloc (sizeof (struct GNUNET_PEERINFO_IteratorContext)); | 711 | ic = GNUNET_new (struct GNUNET_PEERINFO_IteratorContext); |
712 | if (NULL == peer) | 712 | if (NULL == peer) |
713 | { | 713 | { |
714 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 714 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
diff --git a/src/peerinfo/peerinfo_api_notify.c b/src/peerinfo/peerinfo_api_notify.c index f5a076a20..af41b08f9 100644 --- a/src/peerinfo/peerinfo_api_notify.c +++ b/src/peerinfo/peerinfo_api_notify.c | |||
@@ -269,7 +269,7 @@ GNUNET_PEERINFO_notify (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
269 | "peerinfo"); | 269 | "peerinfo"); |
270 | return NULL; | 270 | return NULL; |
271 | } | 271 | } |
272 | nc = GNUNET_malloc (sizeof (struct GNUNET_PEERINFO_NotifyContext)); | 272 | nc = GNUNET_new (struct GNUNET_PEERINFO_NotifyContext); |
273 | nc->cfg = cfg; | 273 | nc->cfg = cfg; |
274 | nc->client = client; | 274 | nc->client = client; |
275 | nc->callback = callback; | 275 | nc->callback = callback; |
diff --git a/src/regex/gnunet-regex-simulation-profiler.c b/src/regex/gnunet-regex-simulation-profiler.c index fdbc918c2..4b3cf5bcd 100644 --- a/src/regex/gnunet-regex-simulation-profiler.c +++ b/src/regex/gnunet-regex-simulation-profiler.c | |||
@@ -179,7 +179,7 @@ create_meter (unsigned int total, char *start_string, int print) | |||
179 | { | 179 | { |
180 | struct ProgressMeter *ret; | 180 | struct ProgressMeter *ret; |
181 | 181 | ||
182 | ret = GNUNET_malloc (sizeof (struct ProgressMeter)); | 182 | ret = GNUNET_new (struct ProgressMeter); |
183 | ret->print = print; | 183 | ret->print = print; |
184 | ret->total = total; | 184 | ret->total = total; |
185 | ret->modnum = total / 4; | 185 | ret->modnum = total / 4; |
diff --git a/src/regex/plugin_block_regex.c b/src/regex/plugin_block_regex.c index 1db1d0d5e..ac9eee07c 100644 --- a/src/regex/plugin_block_regex.c +++ b/src/regex/plugin_block_regex.c | |||
@@ -320,7 +320,7 @@ libgnunet_plugin_block_regex_init (void *cls) | |||
320 | }; | 320 | }; |
321 | struct GNUNET_BLOCK_PluginFunctions *api; | 321 | struct GNUNET_BLOCK_PluginFunctions *api; |
322 | 322 | ||
323 | api = GNUNET_malloc (sizeof (struct GNUNET_BLOCK_PluginFunctions)); | 323 | api = GNUNET_new (struct GNUNET_BLOCK_PluginFunctions); |
324 | api->evaluate = &block_plugin_regex_evaluate; | 324 | api->evaluate = &block_plugin_regex_evaluate; |
325 | api->get_key = &block_plugin_regex_get_key; | 325 | api->get_key = &block_plugin_regex_get_key; |
326 | api->types = types; | 326 | api->types = types; |
diff --git a/src/regex/regex_internal.c b/src/regex/regex_internal.c index 4e0d5acc5..2eeb48b3b 100644 --- a/src/regex/regex_internal.c +++ b/src/regex/regex_internal.c | |||
@@ -132,7 +132,7 @@ state_add_transition (struct REGEX_INTERNAL_Context *ctx, | |||
132 | break; | 132 | break; |
133 | } | 133 | } |
134 | 134 | ||
135 | t = GNUNET_malloc (sizeof (struct REGEX_INTERNAL_Transition)); | 135 | t = GNUNET_new (struct REGEX_INTERNAL_Transition); |
136 | if (NULL != ctx) | 136 | if (NULL != ctx) |
137 | t->id = ctx->transition_id++; | 137 | t->id = ctx->transition_id++; |
138 | if (NULL != label) | 138 | if (NULL != label) |
@@ -1774,7 +1774,7 @@ dfa_state_create (struct REGEX_INTERNAL_Context *ctx, | |||
1774 | struct REGEX_INTERNAL_Transition *ctran; | 1774 | struct REGEX_INTERNAL_Transition *ctran; |
1775 | unsigned int i; | 1775 | unsigned int i; |
1776 | 1776 | ||
1777 | s = GNUNET_malloc (sizeof (struct REGEX_INTERNAL_State)); | 1777 | s = GNUNET_new (struct REGEX_INTERNAL_State); |
1778 | s->id = ctx->state_id++; | 1778 | s->id = ctx->state_id++; |
1779 | s->index = -1; | 1779 | s->index = -1; |
1780 | s->lowlink = -1; | 1780 | s->lowlink = -1; |
@@ -2143,7 +2143,7 @@ dfa_add_multi_strides_helper (void *cls, const unsigned int depth, char *label, | |||
2143 | 2143 | ||
2144 | if (depth == ctx->stride) | 2144 | if (depth == ctx->stride) |
2145 | { | 2145 | { |
2146 | t = GNUNET_malloc (sizeof (struct REGEX_INTERNAL_Transition)); | 2146 | t = GNUNET_new (struct REGEX_INTERNAL_Transition); |
2147 | t->label = GNUNET_strdup (label); | 2147 | t->label = GNUNET_strdup (label); |
2148 | t->to_state = s; | 2148 | t->to_state = s; |
2149 | t->from_state = start; | 2149 | t->from_state = start; |
@@ -2258,7 +2258,7 @@ dfa_compress_paths_helper (struct REGEX_INTERNAL_Automaton *dfa, | |||
2258 | max_len == strlen (label)) || | 2258 | max_len == strlen (label)) || |
2259 | (start == dfa->start && GNUNET_REGEX_INITIAL_BYTES == strlen (label)))) | 2259 | (start == dfa->start && GNUNET_REGEX_INITIAL_BYTES == strlen (label)))) |
2260 | { | 2260 | { |
2261 | t = GNUNET_malloc (sizeof (struct REGEX_INTERNAL_Transition)); | 2261 | t = GNUNET_new (struct REGEX_INTERNAL_Transition); |
2262 | t->label = GNUNET_strdup (label); | 2262 | t->label = GNUNET_strdup (label); |
2263 | t->to_state = cur; | 2263 | t->to_state = cur; |
2264 | t->from_state = start; | 2264 | t->from_state = start; |
@@ -2375,7 +2375,7 @@ nfa_fragment_create (struct REGEX_INTERNAL_State *start, | |||
2375 | { | 2375 | { |
2376 | struct REGEX_INTERNAL_Automaton *n; | 2376 | struct REGEX_INTERNAL_Automaton *n; |
2377 | 2377 | ||
2378 | n = GNUNET_malloc (sizeof (struct REGEX_INTERNAL_Automaton)); | 2378 | n = GNUNET_new (struct REGEX_INTERNAL_Automaton); |
2379 | 2379 | ||
2380 | n->type = NFA; | 2380 | n->type = NFA; |
2381 | n->start = NULL; | 2381 | n->start = NULL; |
@@ -2448,7 +2448,7 @@ nfa_state_create (struct REGEX_INTERNAL_Context *ctx, int accepting) | |||
2448 | { | 2448 | { |
2449 | struct REGEX_INTERNAL_State *s; | 2449 | struct REGEX_INTERNAL_State *s; |
2450 | 2450 | ||
2451 | s = GNUNET_malloc (sizeof (struct REGEX_INTERNAL_State)); | 2451 | s = GNUNET_new (struct REGEX_INTERNAL_State); |
2452 | s->id = ctx->state_id++; | 2452 | s->id = ctx->state_id++; |
2453 | s->accepting = accepting; | 2453 | s->accepting = accepting; |
2454 | s->marked = GNUNET_NO; | 2454 | s->marked = GNUNET_NO; |
@@ -3043,7 +3043,7 @@ REGEX_INTERNAL_construct_dfa (const char *regex, const size_t len, | |||
3043 | return NULL; | 3043 | return NULL; |
3044 | } | 3044 | } |
3045 | 3045 | ||
3046 | dfa = GNUNET_malloc (sizeof (struct REGEX_INTERNAL_Automaton)); | 3046 | dfa = GNUNET_new (struct REGEX_INTERNAL_Automaton); |
3047 | dfa->type = DFA; | 3047 | dfa->type = DFA; |
3048 | dfa->regex = GNUNET_strdup (regex); | 3048 | dfa->regex = GNUNET_strdup (regex); |
3049 | 3049 | ||
diff --git a/src/regex/regex_internal_dht.c b/src/regex/regex_internal_dht.c index e87881902..f7d383406 100644 --- a/src/regex/regex_internal_dht.c +++ b/src/regex/regex_internal_dht.c | |||
@@ -187,7 +187,7 @@ REGEX_INTERNAL_announce (struct GNUNET_DHT_Handle *dht, | |||
187 | struct REGEX_INTERNAL_Announcement *h; | 187 | struct REGEX_INTERNAL_Announcement *h; |
188 | 188 | ||
189 | GNUNET_assert (NULL != dht); | 189 | GNUNET_assert (NULL != dht); |
190 | h = GNUNET_malloc (sizeof (struct REGEX_INTERNAL_Announcement)); | 190 | h = GNUNET_new (struct REGEX_INTERNAL_Announcement); |
191 | h->regex = regex; | 191 | h->regex = regex; |
192 | h->dht = dht; | 192 | h->dht = dht; |
193 | h->stats = stats; | 193 | h->stats = stats; |
@@ -614,7 +614,7 @@ regex_next_edge (const struct RegexBlock *block, | |||
614 | } | 614 | } |
615 | 615 | ||
616 | hash = &ctx->hash; | 616 | hash = &ctx->hash; |
617 | new_ctx = GNUNET_malloc (sizeof (struct RegexSearchContext)); | 617 | new_ctx = GNUNET_new (struct RegexSearchContext); |
618 | new_ctx->info = info; | 618 | new_ctx->info = info; |
619 | new_ctx->position = ctx->position + ctx->longest_match; | 619 | new_ctx->position = ctx->position + ctx->longest_match; |
620 | GNUNET_array_append (info->contexts, info->n_contexts, new_ctx); | 620 | GNUNET_array_append (info->contexts, info->n_contexts, new_ctx); |
@@ -693,7 +693,7 @@ REGEX_INTERNAL_search (struct GNUNET_DHT_Handle *dht, | |||
693 | LOG (GNUNET_ERROR_TYPE_INFO, "REGEX_INTERNAL_search: %s\n", string); | 693 | LOG (GNUNET_ERROR_TYPE_INFO, "REGEX_INTERNAL_search: %s\n", string); |
694 | GNUNET_assert (NULL != dht); | 694 | GNUNET_assert (NULL != dht); |
695 | GNUNET_assert (NULL != callback); | 695 | GNUNET_assert (NULL != callback); |
696 | h = GNUNET_malloc (sizeof (struct REGEX_INTERNAL_Search)); | 696 | h = GNUNET_new (struct REGEX_INTERNAL_Search); |
697 | h->dht = dht; | 697 | h->dht = dht; |
698 | h->description = GNUNET_strdup (string); | 698 | h->description = GNUNET_strdup (string); |
699 | h->callback = callback; | 699 | h->callback = callback; |
@@ -708,7 +708,7 @@ REGEX_INTERNAL_search (struct GNUNET_DHT_Handle *dht, | |||
708 | LOG (GNUNET_ERROR_TYPE_INFO, | 708 | LOG (GNUNET_ERROR_TYPE_INFO, |
709 | " initial key for %s: %s (%.*s)\n", | 709 | " initial key for %s: %s (%.*s)\n", |
710 | string, GNUNET_h2s (&key), size, string); | 710 | string, GNUNET_h2s (&key), size, string); |
711 | ctx = GNUNET_malloc (sizeof (struct RegexSearchContext)); | 711 | ctx = GNUNET_new (struct RegexSearchContext); |
712 | ctx->position = size; | 712 | ctx->position = size; |
713 | ctx->info = h; | 713 | ctx->info = h; |
714 | GNUNET_array_append (h->contexts, h->n_contexts, ctx); | 714 | GNUNET_array_append (h->contexts, h->n_contexts, ctx); |
diff --git a/src/regex/regex_test_lib.c b/src/regex/regex_test_lib.c index 09d608e65..2f3abdc65 100644 --- a/src/regex/regex_test_lib.c +++ b/src/regex/regex_test_lib.c | |||
@@ -245,7 +245,7 @@ regex_add (struct RegexCombineCtx *ctx, const char *regex) | |||
245 | len = strlen (p->s); | 245 | len = strlen (p->s); |
246 | if (prefix_l < len) /* only partial match, split existing state */ | 246 | if (prefix_l < len) /* only partial match, split existing state */ |
247 | { | 247 | { |
248 | newctx = GNUNET_malloc (sizeof (struct RegexCombineCtx)); | 248 | newctx = GNUNET_new (struct RegexCombineCtx); |
249 | newctx->head = p->head; | 249 | newctx->head = p->head; |
250 | newctx->tail = p->tail; | 250 | newctx->tail = p->tail; |
251 | newctx->s = GNUNET_malloc(len - prefix_l + 1); | 251 | newctx->s = GNUNET_malloc(len - prefix_l + 1); |
@@ -262,14 +262,14 @@ regex_add (struct RegexCombineCtx *ctx, const char *regex) | |||
262 | if (NULL == ctx->head && NULL != ctx->s) | 262 | if (NULL == ctx->head && NULL != ctx->s) |
263 | { | 263 | { |
264 | /* this was the end before, add empty string */ | 264 | /* this was the end before, add empty string */ |
265 | newctx = GNUNET_malloc (sizeof (struct RegexCombineCtx)); | 265 | newctx = GNUNET_new (struct RegexCombineCtx); |
266 | newctx->s = GNUNET_strdup (""); | 266 | newctx->s = GNUNET_strdup (""); |
267 | GNUNET_CONTAINER_DLL_insert (ctx->head, ctx->tail, newctx); | 267 | GNUNET_CONTAINER_DLL_insert (ctx->head, ctx->tail, newctx); |
268 | } | 268 | } |
269 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " no match\n"); | 269 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " no match\n"); |
270 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " new state %s\n", regex); | 270 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " new state %s\n", regex); |
271 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " under %s\n", ctx->s); | 271 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " under %s\n", ctx->s); |
272 | newctx = GNUNET_malloc (sizeof (struct RegexCombineCtx)); | 272 | newctx = GNUNET_new (struct RegexCombineCtx); |
273 | newctx->s = GNUNET_strdup (regex); | 273 | newctx->s = GNUNET_strdup (regex); |
274 | GNUNET_CONTAINER_DLL_insert (ctx->head, ctx->tail, newctx); | 274 | GNUNET_CONTAINER_DLL_insert (ctx->head, ctx->tail, newctx); |
275 | } | 275 | } |
@@ -312,7 +312,7 @@ REGEX_TEST_combine (char * const regexes[]) | |||
312 | const char *current; | 312 | const char *current; |
313 | struct RegexCombineCtx *ctx; | 313 | struct RegexCombineCtx *ctx; |
314 | 314 | ||
315 | ctx = GNUNET_malloc (sizeof (struct RegexCombineCtx)); | 315 | ctx = GNUNET_new (struct RegexCombineCtx); |
316 | for (i = 0; regexes[i]; i++) | 316 | for (i = 0; regexes[i]; i++) |
317 | { | 317 | { |
318 | current = regexes[i]; | 318 | current = regexes[i]; |
diff --git a/src/set/ibf.c b/src/set/ibf.c index 4d40f1f35..152f9b190 100644 --- a/src/set/ibf.c +++ b/src/set/ibf.c | |||
@@ -78,7 +78,7 @@ ibf_create (uint32_t size, uint8_t hash_num) | |||
78 | 78 | ||
79 | /* TODO: use malloc_large */ | 79 | /* TODO: use malloc_large */ |
80 | 80 | ||
81 | ibf = GNUNET_malloc (sizeof (struct InvertibleBloomFilter)); | 81 | ibf = GNUNET_new (struct InvertibleBloomFilter); |
82 | ibf->count = GNUNET_malloc (size * sizeof (uint8_t)); | 82 | ibf->count = GNUNET_malloc (size * sizeof (uint8_t)); |
83 | ibf->key_sum = GNUNET_malloc (size * sizeof (struct IBF_Key)); | 83 | ibf->key_sum = GNUNET_malloc (size * sizeof (struct IBF_Key)); |
84 | ibf->key_hash_sum = GNUNET_malloc (size * sizeof (struct IBF_KeyHash)); | 84 | ibf->key_hash_sum = GNUNET_malloc (size * sizeof (struct IBF_KeyHash)); |
diff --git a/src/set/strata_estimator.c b/src/set/strata_estimator.c index c719a5836..a148c1488 100644 --- a/src/set/strata_estimator.c +++ b/src/set/strata_estimator.c | |||
@@ -89,7 +89,7 @@ strata_estimator_create (unsigned int strata_count, uint32_t ibf_size, uint8_t i | |||
89 | 89 | ||
90 | /* fixme: allocate everything in one chunk */ | 90 | /* fixme: allocate everything in one chunk */ |
91 | 91 | ||
92 | se = GNUNET_malloc (sizeof (struct StrataEstimator)); | 92 | se = GNUNET_new (struct StrataEstimator); |
93 | se->strata_count = strata_count; | 93 | se->strata_count = strata_count; |
94 | se->ibf_size = ibf_size; | 94 | se->ibf_size = ibf_size; |
95 | se->strata = GNUNET_malloc (sizeof (struct InvertibleBloomFilter *) * strata_count); | 95 | se->strata = GNUNET_malloc (sizeof (struct InvertibleBloomFilter *) * strata_count); |
@@ -159,7 +159,7 @@ strata_estimator_dup (struct StrataEstimator *se) | |||
159 | struct StrataEstimator *c; | 159 | struct StrataEstimator *c; |
160 | int i; | 160 | int i; |
161 | 161 | ||
162 | c = GNUNET_malloc (sizeof (struct StrataEstimator)); | 162 | c = GNUNET_new (struct StrataEstimator); |
163 | c->strata_count = se->strata_count; | 163 | c->strata_count = se->strata_count; |
164 | c->ibf_size = se->ibf_size; | 164 | c->ibf_size = se->ibf_size; |
165 | c->strata = GNUNET_malloc (sizeof (struct InvertibleBloomFilter *) * se->strata_count); | 165 | c->strata = GNUNET_malloc (sizeof (struct InvertibleBloomFilter *) * se->strata_count); |
diff --git a/src/statistics/statistics_api.c b/src/statistics/statistics_api.c index d99ad8aec..04e85a07e 100644 --- a/src/statistics/statistics_api.c +++ b/src/statistics/statistics_api.c | |||
@@ -343,7 +343,7 @@ schedule_watch_request (struct GNUNET_STATISTICS_Handle *h, | |||
343 | GNUNET_break (0); | 343 | GNUNET_break (0); |
344 | return; | 344 | return; |
345 | } | 345 | } |
346 | ai = GNUNET_malloc (sizeof (struct GNUNET_STATISTICS_GetHandle)); | 346 | ai = GNUNET_new (struct GNUNET_STATISTICS_GetHandle); |
347 | ai->sh = h; | 347 | ai->sh = h; |
348 | ai->subsystem = GNUNET_strdup (watch->subsystem); | 348 | ai->subsystem = GNUNET_strdup (watch->subsystem); |
349 | ai->name = GNUNET_strdup (watch->name); | 349 | ai->name = GNUNET_strdup (watch->name); |
@@ -932,7 +932,7 @@ GNUNET_STATISTICS_create (const char *subsystem, | |||
932 | return NULL; | 932 | return NULL; |
933 | GNUNET_assert (NULL != subsystem); | 933 | GNUNET_assert (NULL != subsystem); |
934 | GNUNET_assert (NULL != cfg); | 934 | GNUNET_assert (NULL != cfg); |
935 | ret = GNUNET_malloc (sizeof (struct GNUNET_STATISTICS_Handle)); | 935 | ret = GNUNET_new (struct GNUNET_STATISTICS_Handle); |
936 | ret->cfg = cfg; | 936 | ret->cfg = cfg; |
937 | ret->subsystem = GNUNET_strdup (subsystem); | 937 | ret->subsystem = GNUNET_strdup (subsystem); |
938 | ret->backoff = GNUNET_TIME_UNIT_MILLISECONDS; | 938 | ret->backoff = GNUNET_TIME_UNIT_MILLISECONDS; |
@@ -1158,7 +1158,7 @@ GNUNET_STATISTICS_get (struct GNUNET_STATISTICS_Handle *handle, | |||
1158 | slen2 = strlen (name) + 1; | 1158 | slen2 = strlen (name) + 1; |
1159 | GNUNET_assert (slen1 + slen2 + sizeof (struct GNUNET_MessageHeader) < | 1159 | GNUNET_assert (slen1 + slen2 + sizeof (struct GNUNET_MessageHeader) < |
1160 | GNUNET_SERVER_MAX_MESSAGE_SIZE); | 1160 | GNUNET_SERVER_MAX_MESSAGE_SIZE); |
1161 | ai = GNUNET_malloc (sizeof (struct GNUNET_STATISTICS_GetHandle)); | 1161 | ai = GNUNET_new (struct GNUNET_STATISTICS_GetHandle); |
1162 | ai->sh = handle; | 1162 | ai->sh = handle; |
1163 | ai->subsystem = GNUNET_strdup (subsystem); | 1163 | ai->subsystem = GNUNET_strdup (subsystem); |
1164 | ai->name = GNUNET_strdup (name); | 1164 | ai->name = GNUNET_strdup (name); |
@@ -1220,7 +1220,7 @@ GNUNET_STATISTICS_watch (struct GNUNET_STATISTICS_Handle *handle, | |||
1220 | 1220 | ||
1221 | if (NULL == handle) | 1221 | if (NULL == handle) |
1222 | return GNUNET_SYSERR; | 1222 | return GNUNET_SYSERR; |
1223 | w = GNUNET_malloc (sizeof (struct GNUNET_STATISTICS_WatchEntry)); | 1223 | w = GNUNET_new (struct GNUNET_STATISTICS_WatchEntry); |
1224 | w->subsystem = GNUNET_strdup (subsystem); | 1224 | w->subsystem = GNUNET_strdup (subsystem); |
1225 | w->name = GNUNET_strdup (name); | 1225 | w->name = GNUNET_strdup (name); |
1226 | w->proc = proc; | 1226 | w->proc = proc; |
@@ -1354,7 +1354,7 @@ add_setter_action (struct GNUNET_STATISTICS_Handle *h, const char *name, | |||
1354 | return; | 1354 | return; |
1355 | } | 1355 | } |
1356 | /* no existing entry matches, create a fresh one */ | 1356 | /* no existing entry matches, create a fresh one */ |
1357 | ai = GNUNET_malloc (sizeof (struct GNUNET_STATISTICS_GetHandle)); | 1357 | ai = GNUNET_new (struct GNUNET_STATISTICS_GetHandle); |
1358 | ai->sh = h; | 1358 | ai->sh = h; |
1359 | ai->subsystem = GNUNET_strdup (h->subsystem); | 1359 | ai->subsystem = GNUNET_strdup (h->subsystem); |
1360 | ai->name = GNUNET_strdup (name); | 1360 | ai->name = GNUNET_strdup (name); |
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 | } |
diff --git a/src/testing/test_testing_peerstartup.c b/src/testing/test_testing_peerstartup.c index b871ed1e3..e025b4138 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, | |||
95 | char *emsg; | 95 | char *emsg; |
96 | struct GNUNET_PeerIdentity id; | 96 | struct GNUNET_PeerIdentity id; |
97 | 97 | ||
98 | test_ctx = GNUNET_malloc (sizeof (struct TestingContext)); | 98 | test_ctx = GNUNET_new (struct TestingContext); |
99 | test_ctx->system = | 99 | test_ctx->system = |
100 | GNUNET_TESTING_system_create ("test-gnunet-testing", | 100 | GNUNET_TESTING_system_create ("test-gnunet-testing", |
101 | "127.0.0.1", NULL, NULL); | 101 | "127.0.0.1", NULL, NULL); |
diff --git a/src/testing/test_testing_peerstartup2.c b/src/testing/test_testing_peerstartup2.c index a4bdd4d65..2bdae72eb 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, | |||
164 | char *emsg; | 164 | char *emsg; |
165 | struct GNUNET_PeerIdentity id; | 165 | struct GNUNET_PeerIdentity id; |
166 | 166 | ||
167 | test_ctx = GNUNET_malloc (sizeof (struct TestingContext)); | 167 | test_ctx = GNUNET_new (struct TestingContext); |
168 | test_ctx->system = | 168 | test_ctx->system = |
169 | GNUNET_TESTING_system_create ("test-gnunet-testing", | 169 | GNUNET_TESTING_system_create ("test-gnunet-testing", |
170 | "127.0.0.1", NULL, NULL); | 170 | "127.0.0.1", NULL, NULL); |
diff --git a/src/testing/test_testing_sharedservices.c b/src/testing/test_testing_sharedservices.c index 5b5bc0a24..e2f956e62 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, | |||
107 | struct GNUNET_TESTING_Peer *peer; | 107 | struct GNUNET_TESTING_Peer *peer; |
108 | unsigned int cnt; | 108 | unsigned int cnt; |
109 | 109 | ||
110 | test_ctx = GNUNET_malloc (sizeof (struct TestingContext)); | 110 | test_ctx = GNUNET_new (struct TestingContext); |
111 | test_ctx->system = | 111 | test_ctx->system = |
112 | GNUNET_TESTING_system_create ("test-gnunet-testing", | 112 | GNUNET_TESTING_system_create ("test-gnunet-testing", |
113 | "127.0.0.1", NULL, ss); | 113 | "127.0.0.1", NULL, ss); |
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)); |
diff --git a/src/topology/gnunet-daemon-topology.c b/src/topology/gnunet-daemon-topology.c index 7e21d882b..e4e9808e4 100644 --- a/src/topology/gnunet-daemon-topology.c +++ b/src/topology/gnunet-daemon-topology.c | |||
@@ -483,7 +483,7 @@ make_peer (const struct GNUNET_PeerIdentity *peer, | |||
483 | { | 483 | { |
484 | struct Peer *ret; | 484 | struct Peer *ret; |
485 | 485 | ||
486 | ret = GNUNET_malloc (sizeof (struct Peer)); | 486 | ret = GNUNET_new (struct Peer); |
487 | ret->pid = *peer; | 487 | ret->pid = *peer; |
488 | ret->is_friend = is_friend; | 488 | ret->is_friend = is_friend; |
489 | if (hello != NULL) | 489 | if (hello != NULL) |
diff --git a/src/transport/gnunet-service-transport_blacklist.c b/src/transport/gnunet-service-transport_blacklist.c index 87d753929..db154d911 100644 --- a/src/transport/gnunet-service-transport_blacklist.c +++ b/src/transport/gnunet-service-transport_blacklist.c | |||
@@ -494,7 +494,7 @@ test_connection_ok (void *cls, const struct GNUNET_PeerIdentity *neighbour, | |||
494 | struct TestConnectionContext *tcc = cls; | 494 | struct TestConnectionContext *tcc = cls; |
495 | struct GST_BlacklistCheck *bc; | 495 | struct GST_BlacklistCheck *bc; |
496 | 496 | ||
497 | bc = GNUNET_malloc (sizeof (struct GST_BlacklistCheck)); | 497 | bc = GNUNET_new (struct GST_BlacklistCheck); |
498 | GNUNET_CONTAINER_DLL_insert (bc_head, bc_tail, bc); | 498 | GNUNET_CONTAINER_DLL_insert (bc_head, bc_tail, bc); |
499 | bc->peer = *neighbour; | 499 | bc->peer = *neighbour; |
500 | bc->cont = &confirm_or_drop_neighbour; | 500 | bc->cont = &confirm_or_drop_neighbour; |
@@ -538,7 +538,7 @@ GST_blacklist_handle_init (void *cls, struct GNUNET_SERVER_Client *client, | |||
538 | bl = bl->next; | 538 | bl = bl->next; |
539 | } | 539 | } |
540 | GNUNET_SERVER_client_mark_monitor (client); | 540 | GNUNET_SERVER_client_mark_monitor (client); |
541 | bl = GNUNET_malloc (sizeof (struct Blacklisters)); | 541 | bl = GNUNET_new (struct Blacklisters); |
542 | bl->client = client; | 542 | bl->client = client; |
543 | GNUNET_SERVER_client_keep (client); | 543 | GNUNET_SERVER_client_keep (client); |
544 | GNUNET_CONTAINER_DLL_insert_after (bl_head, bl_tail, bl_tail, bl); | 544 | GNUNET_CONTAINER_DLL_insert_after (bl_head, bl_tail, bl_tail, bl); |
@@ -739,7 +739,7 @@ GST_blacklist_test_allowed (const struct GNUNET_PeerIdentity *peer, | |||
739 | } | 739 | } |
740 | 740 | ||
741 | /* need to query blacklist clients */ | 741 | /* need to query blacklist clients */ |
742 | bc = GNUNET_malloc (sizeof (struct GST_BlacklistCheck)); | 742 | bc = GNUNET_new (struct GST_BlacklistCheck); |
743 | GNUNET_CONTAINER_DLL_insert (bc_head, bc_tail, bc); | 743 | GNUNET_CONTAINER_DLL_insert (bc_head, bc_tail, bc); |
744 | bc->peer = *peer; | 744 | bc->peer = *peer; |
745 | bc->cont = cont; | 745 | bc->cont = cont; |
diff --git a/src/transport/gnunet-service-transport_clients.c b/src/transport/gnunet-service-transport_clients.c index 0aeb661d4..8679f40b4 100644 --- a/src/transport/gnunet-service-transport_clients.c +++ b/src/transport/gnunet-service-transport_clients.c | |||
@@ -677,7 +677,7 @@ clients_handle_send (void *cls, | |||
677 | return; | 677 | return; |
678 | } | 678 | } |
679 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 679 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
680 | stcc = GNUNET_malloc (sizeof (struct SendTransmitContinuationContext)); | 680 | stcc = GNUNET_new (struct SendTransmitContinuationContext); |
681 | stcc->target = obm->peer; | 681 | stcc->target = obm->peer; |
682 | stcc->client = client; | 682 | stcc->client = client; |
683 | GNUNET_SERVER_client_keep (client); | 683 | GNUNET_SERVER_client_keep (client); |
diff --git a/src/transport/gnunet-service-transport_hello.c b/src/transport/gnunet-service-transport_hello.c index 6bf707755..626be54c1 100644 --- a/src/transport/gnunet-service-transport_hello.c +++ b/src/transport/gnunet-service-transport_hello.c | |||
@@ -288,7 +288,7 @@ GST_hello_modify_addresses (int addremove, | |||
288 | GNUNET_break (0); | 288 | GNUNET_break (0); |
289 | return; | 289 | return; |
290 | } | 290 | } |
291 | al = GNUNET_malloc (sizeof (struct OwnAddressList)); | 291 | al = GNUNET_new (struct OwnAddressList); |
292 | GNUNET_CONTAINER_DLL_insert (oal_head, oal_tail, al); | 292 | GNUNET_CONTAINER_DLL_insert (oal_head, oal_tail, al); |
293 | al->address = GNUNET_HELLO_address_copy (address); | 293 | al->address = GNUNET_HELLO_address_copy (address); |
294 | refresh_hello (); | 294 | refresh_hello (); |
diff --git a/src/transport/gnunet-service-transport_manipulation.c b/src/transport/gnunet-service-transport_manipulation.c index 1b708cb70..da3fc2de9 100644 --- a/src/transport/gnunet-service-transport_manipulation.c +++ b/src/transport/gnunet-service-transport_manipulation.c | |||
@@ -210,7 +210,7 @@ set_metric (struct TM_Peer *dest, int direction, uint32_t type, uint32_t value) | |||
210 | } | 210 | } |
211 | if (NULL == cur) | 211 | if (NULL == cur) |
212 | { | 212 | { |
213 | cur = GNUNET_malloc (sizeof (struct PropManipulationEntry)); | 213 | cur = GNUNET_new (struct PropManipulationEntry); |
214 | GNUNET_CONTAINER_DLL_insert (dest->head, dest->tail, cur); | 214 | GNUNET_CONTAINER_DLL_insert (dest->head, dest->tail, cur); |
215 | cur->type = type; | 215 | cur->type = type; |
216 | cur->metrics[TM_SEND] = UINT32_MAX; | 216 | cur->metrics[TM_SEND] = UINT32_MAX; |
@@ -327,7 +327,7 @@ GST_manipulation_set_metric (void *cls, struct GNUNET_SERVER_Client *client, | |||
327 | 327 | ||
328 | if (NULL == (tmp = GNUNET_CONTAINER_multipeermap_get (man_handle.peers, &tm->peer))) | 328 | if (NULL == (tmp = GNUNET_CONTAINER_multipeermap_get (man_handle.peers, &tm->peer))) |
329 | { | 329 | { |
330 | tmp = GNUNET_malloc (sizeof (struct TM_Peer)); | 330 | tmp = GNUNET_new (struct TM_Peer); |
331 | tmp->peer = (tm->peer); | 331 | tmp->peer = (tm->peer); |
332 | for (c = 0; c < TM_BOTH; c++) | 332 | for (c = 0; c < TM_BOTH; c++) |
333 | { | 333 | { |
diff --git a/src/transport/gnunet-service-transport_validation.c b/src/transport/gnunet-service-transport_validation.c index c0e605114..d56aac8ad 100644 --- a/src/transport/gnunet-service-transport_validation.c +++ b/src/transport/gnunet-service-transport_validation.c | |||
@@ -718,7 +718,7 @@ find_validation_entry (const struct GNUNET_CRYPTO_EddsaPublicKey *public_key, | |||
718 | return ve; | 718 | return ve; |
719 | if (public_key == NULL) | 719 | if (public_key == NULL) |
720 | return NULL; | 720 | return NULL; |
721 | ve = GNUNET_malloc (sizeof (struct ValidationEntry)); | 721 | ve = GNUNET_new (struct ValidationEntry); |
722 | ve->in_use = GNUNET_SYSERR; /* not defined */ | 722 | ve->in_use = GNUNET_SYSERR; /* not defined */ |
723 | ve->last_line_set_to_no = 0; | 723 | ve->last_line_set_to_no = 0; |
724 | ve->last_line_set_to_yes = 0; | 724 | ve->last_line_set_to_yes = 0; |
diff --git a/src/transport/plugin_transport_bluetooth.c b/src/transport/plugin_transport_bluetooth.c index 51e8a89bd..a7d3cf3f5 100644 --- a/src/transport/plugin_transport_bluetooth.c +++ b/src/transport/plugin_transport_bluetooth.c | |||
@@ -730,7 +730,7 @@ create_session (struct MacEndpoint *endpoint, | |||
730 | } | 730 | } |
731 | GNUNET_STATISTICS_update (endpoint->plugin->env->stats, _("# Bluetooth sessions allocated"), 1, | 731 | GNUNET_STATISTICS_update (endpoint->plugin->env->stats, _("# Bluetooth sessions allocated"), 1, |
732 | GNUNET_NO); | 732 | GNUNET_NO); |
733 | session = GNUNET_malloc (sizeof (struct Session)); | 733 | session = GNUNET_new (struct Session); |
734 | GNUNET_CONTAINER_DLL_insert_tail (endpoint->sessions_head, | 734 | GNUNET_CONTAINER_DLL_insert_tail (endpoint->sessions_head, |
735 | endpoint->sessions_tail, | 735 | endpoint->sessions_tail, |
736 | session); | 736 | session); |
@@ -897,7 +897,7 @@ send_with_fragmentation (struct MacEndpoint *endpoint, | |||
897 | struct Plugin *plugin; | 897 | struct Plugin *plugin; |
898 | 898 | ||
899 | plugin = endpoint->plugin; | 899 | plugin = endpoint->plugin; |
900 | fm = GNUNET_malloc (sizeof (struct FragmentMessage)); | 900 | fm = GNUNET_new (struct FragmentMessage); |
901 | fm->macendpoint = endpoint; | 901 | fm->macendpoint = endpoint; |
902 | fm->target = *target; | 902 | fm->target = *target; |
903 | fm->size_payload = payload_size; | 903 | fm->size_payload = payload_size; |
@@ -1001,7 +1001,7 @@ create_macendpoint (struct Plugin *plugin, | |||
1001 | for (pos = plugin->mac_head; NULL != pos; pos = pos->next) | 1001 | for (pos = plugin->mac_head; NULL != pos; pos = pos->next) |
1002 | if (0 == memcmp (addr, &pos->addr, sizeof (struct WlanAddress))) | 1002 | if (0 == memcmp (addr, &pos->addr, sizeof (struct WlanAddress))) |
1003 | return pos; | 1003 | return pos; |
1004 | pos = GNUNET_malloc (sizeof (struct MacEndpoint)); | 1004 | pos = GNUNET_new (struct MacEndpoint); |
1005 | pos->addr = *addr; | 1005 | pos->addr = *addr; |
1006 | pos->plugin = plugin; | 1006 | pos->plugin = plugin; |
1007 | pos->defrag = | 1007 | pos->defrag = |
@@ -1790,7 +1790,7 @@ bluetooth_string_to_address (void *cls, const char *addr, uint16_t addrlen, | |||
1790 | GNUNET_break (0); | 1790 | GNUNET_break (0); |
1791 | return GNUNET_SYSERR; | 1791 | return GNUNET_SYSERR; |
1792 | } | 1792 | } |
1793 | wa = GNUNET_malloc (sizeof (struct WlanAddress)); | 1793 | wa = GNUNET_new (struct WlanAddress); |
1794 | for (i=0;i<6;i++) | 1794 | for (i=0;i<6;i++) |
1795 | wa->mac.mac[i] = a[i]; | 1795 | wa->mac.mac[i] = a[i]; |
1796 | wa->options = htonl (0); | 1796 | wa->options = htonl (0); |
@@ -1833,7 +1833,7 @@ libgnunet_plugin_transport_bluetooth_init (void *cls) | |||
1833 | { | 1833 | { |
1834 | /* run in 'stub' mode (i.e. as part of gnunet-peerinfo), don't fully | 1834 | /* run in 'stub' mode (i.e. as part of gnunet-peerinfo), don't fully |
1835 | initialze the plugin or the API */ | 1835 | initialze the plugin or the API */ |
1836 | api = GNUNET_malloc (sizeof (struct GNUNET_TRANSPORT_PluginFunctions)); | 1836 | api = GNUNET_new (struct GNUNET_TRANSPORT_PluginFunctions); |
1837 | api->cls = NULL; | 1837 | api->cls = NULL; |
1838 | api->address_pretty_printer = &bluetooth_plugin_address_pretty_printer; | 1838 | api->address_pretty_printer = &bluetooth_plugin_address_pretty_printer; |
1839 | api->address_to_string = &bluetooth_plugin_address_to_string; | 1839 | api->address_to_string = &bluetooth_plugin_address_to_string; |
@@ -1875,7 +1875,7 @@ libgnunet_plugin_transport_bluetooth_init (void *cls) | |||
1875 | return NULL; | 1875 | return NULL; |
1876 | } | 1876 | } |
1877 | 1877 | ||
1878 | plugin = GNUNET_malloc (sizeof (struct Plugin)); | 1878 | plugin = GNUNET_new (struct Plugin); |
1879 | plugin->interface = interface; | 1879 | plugin->interface = interface; |
1880 | plugin->env = env; | 1880 | plugin->env = env; |
1881 | GNUNET_STATISTICS_set (plugin->env->stats, _("# Bluetooth sessions allocated"), | 1881 | GNUNET_STATISTICS_set (plugin->env->stats, _("# Bluetooth sessions allocated"), |
@@ -1933,7 +1933,7 @@ libgnunet_plugin_transport_bluetooth_init (void *cls) | |||
1933 | GNUNET_assert (0); | 1933 | GNUNET_assert (0); |
1934 | } | 1934 | } |
1935 | 1935 | ||
1936 | api = GNUNET_malloc (sizeof (struct GNUNET_TRANSPORT_PluginFunctions)); | 1936 | api = GNUNET_new (struct GNUNET_TRANSPORT_PluginFunctions); |
1937 | api->cls = plugin; | 1937 | api->cls = plugin; |
1938 | api->send = &bluetooth_plugin_send; | 1938 | api->send = &bluetooth_plugin_send; |
1939 | api->get_session = &bluetooth_plugin_get_session; | 1939 | api->get_session = &bluetooth_plugin_get_session; |
diff --git a/src/transport/plugin_transport_http_common.c b/src/transport/plugin_transport_http_common.c index de4cb9a26..c020118ac 100644 --- a/src/transport/plugin_transport_http_common.c +++ b/src/transport/plugin_transport_http_common.c | |||
@@ -60,7 +60,7 @@ http_split_address (const char * addr) | |||
60 | char *port_start = NULL; | 60 | char *port_start = NULL; |
61 | char *path_start = NULL; | 61 | char *path_start = NULL; |
62 | protocol_start = src; | 62 | protocol_start = src; |
63 | sp = GNUNET_malloc (sizeof (struct SplittedHTTPAddress)); | 63 | sp = GNUNET_new (struct SplittedHTTPAddress); |
64 | 64 | ||
65 | /* Address string consists of protocol://host[:port]path*/ | 65 | /* Address string consists of protocol://host[:port]path*/ |
66 | 66 | ||
@@ -455,7 +455,7 @@ http_common_socket_from_address (const void *addr, size_t addrlen, int *res) | |||
455 | return NULL; | 455 | return NULL; |
456 | } | 456 | } |
457 | 457 | ||
458 | s = GNUNET_malloc (sizeof (struct sockaddr_storage)); | 458 | s = GNUNET_new (struct sockaddr_storage); |
459 | GNUNET_asprintf (&to_conv, "%s:%u", spa->host, spa->port); | 459 | GNUNET_asprintf (&to_conv, "%s:%u", spa->host, spa->port); |
460 | if (GNUNET_SYSERR == GNUNET_STRINGS_to_address_ip (to_conv, strlen(to_conv), s)) | 460 | if (GNUNET_SYSERR == GNUNET_STRINGS_to_address_ip (to_conv, strlen(to_conv), s)) |
461 | { | 461 | { |
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c index f08c7072a..15c0323c6 100644 --- a/src/transport/plugin_transport_http_server.c +++ b/src/transport/plugin_transport_http_server.c | |||
@@ -2219,7 +2219,7 @@ server_add_address (void *cls, int add_remove, const struct sockaddr *addr, | |||
2219 | struct HTTP_Server_Plugin *plugin = cls; | 2219 | struct HTTP_Server_Plugin *plugin = cls; |
2220 | struct HttpAddressWrapper *w = NULL; | 2220 | struct HttpAddressWrapper *w = NULL; |
2221 | 2221 | ||
2222 | w = GNUNET_malloc (sizeof (struct HttpAddressWrapper)); | 2222 | w = GNUNET_new (struct HttpAddressWrapper); |
2223 | w->address = http_common_address_from_socket (plugin->protocol, addr, addrlen); | 2223 | w->address = http_common_address_from_socket (plugin->protocol, addr, addrlen); |
2224 | if (NULL == w->address) | 2224 | if (NULL == w->address) |
2225 | { | 2225 | { |
@@ -2769,7 +2769,7 @@ server_configure_plugin (struct HTTP_Server_Plugin *plugin) | |||
2769 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, | 2769 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, |
2770 | "Binding %s plugin to specific IPv4 address: `%s'\n", | 2770 | "Binding %s plugin to specific IPv4 address: `%s'\n", |
2771 | plugin->protocol, bind4_address); | 2771 | plugin->protocol, bind4_address); |
2772 | plugin->server_addr_v4 = GNUNET_malloc (sizeof (struct sockaddr_in)); | 2772 | plugin->server_addr_v4 = GNUNET_new (struct sockaddr_in); |
2773 | if (1 != inet_pton (AF_INET, bind4_address, | 2773 | if (1 != inet_pton (AF_INET, bind4_address, |
2774 | &plugin->server_addr_v4->sin_addr)) | 2774 | &plugin->server_addr_v4->sin_addr)) |
2775 | { | 2775 | { |
@@ -2800,7 +2800,7 @@ server_configure_plugin (struct HTTP_Server_Plugin *plugin) | |||
2800 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, | 2800 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, |
2801 | "Binding %s plugin to specific IPv6 address: `%s'\n", | 2801 | "Binding %s plugin to specific IPv6 address: `%s'\n", |
2802 | plugin->protocol, bind6_address); | 2802 | plugin->protocol, bind6_address); |
2803 | plugin->server_addr_v6 = GNUNET_malloc (sizeof (struct sockaddr_in6)); | 2803 | plugin->server_addr_v6 = GNUNET_new (struct sockaddr_in6); |
2804 | if (1 != | 2804 | if (1 != |
2805 | inet_pton (AF_INET6, bind6_address, &plugin->server_addr_v6->sin6_addr)) | 2805 | inet_pton (AF_INET6, bind6_address, &plugin->server_addr_v6->sin6_addr)) |
2806 | { | 2806 | { |
diff --git a/src/transport/plugin_transport_smtp.c b/src/transport/plugin_transport_smtp.c index c886fd132..fd2089367 100644 --- a/src/transport/plugin_transport_smtp.c +++ b/src/transport/plugin_transport_smtp.c | |||
@@ -233,7 +233,7 @@ listenAndDistribute (void *unused) | |||
233 | } | 233 | } |
234 | if (stats != NULL) | 234 | if (stats != NULL) |
235 | stats->change (stat_bytesReceived, size); | 235 | stats->change (stat_bytesReceived, size); |
236 | coreMP = GNUNET_malloc (sizeof (GNUNET_TransportPacket)); | 236 | coreMP = GNUNET_new (GNUNET_TransportPacket); |
237 | coreMP->msg = out; | 237 | coreMP->msg = out; |
238 | coreMP->size = size - sizeof (SMTPMessage); | 238 | coreMP->size = size - sizeof (SMTPMessage); |
239 | coreMP->tsession = NULL; | 239 | coreMP->tsession = NULL; |
@@ -541,7 +541,7 @@ api_connect (const GNUNET_MessageHello * hello, GNUNET_TSession ** tsessionPtr, | |||
541 | { | 541 | { |
542 | GNUNET_TSession *tsession; | 542 | GNUNET_TSession *tsession; |
543 | 543 | ||
544 | tsession = GNUNET_malloc (sizeof (GNUNET_TSession)); | 544 | tsession = GNUNET_new (GNUNET_TSession); |
545 | tsession->internal = GNUNET_malloc (GNUNET_sizeof_hello (hello)); | 545 | tsession->internal = GNUNET_malloc (GNUNET_sizeof_hello (hello)); |
546 | tsession->peer = hello->senderIdentity; | 546 | tsession->peer = hello->senderIdentity; |
547 | memcpy (tsession->internal, hello, GNUNET_sizeof_hello (hello)); | 547 | memcpy (tsession->internal, hello, GNUNET_sizeof_hello (hello)); |
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c index d3f27dec4..04fac9cde 100644 --- a/src/transport/plugin_transport_tcp.c +++ b/src/transport/plugin_transport_tcp.c | |||
@@ -1906,7 +1906,7 @@ tcp_plugin_address_pretty_printer (void *cls, const char *type, | |||
1906 | asc (asc_cls, NULL); | 1906 | asc (asc_cls, NULL); |
1907 | return; | 1907 | return; |
1908 | } | 1908 | } |
1909 | ppc = GNUNET_malloc (sizeof (struct PrettyPrinterContext)); | 1909 | ppc = GNUNET_new (struct PrettyPrinterContext); |
1910 | if (addrlen == sizeof (struct IPv6TcpAddress)) | 1910 | if (addrlen == sizeof (struct IPv6TcpAddress)) |
1911 | ppc->ipv6 = GNUNET_YES; | 1911 | ppc->ipv6 = GNUNET_YES; |
1912 | else | 1912 | else |
@@ -2524,7 +2524,7 @@ try_connection_reversal (void *cls, const struct sockaddr *addr, | |||
2524 | 2524 | ||
2525 | /* FIXME: do we need to track these probe context objects so that | 2525 | /* FIXME: do we need to track these probe context objects so that |
2526 | * we can clean them up on plugin unload? */ | 2526 | * we can clean them up on plugin unload? */ |
2527 | tcp_probe_ctx = GNUNET_malloc (sizeof (struct TCPProbeContext)); | 2527 | tcp_probe_ctx = GNUNET_new (struct TCPProbeContext); |
2528 | tcp_probe_ctx->message.header.size = | 2528 | tcp_probe_ctx->message.header.size = |
2529 | htons (sizeof (struct TCP_NAT_ProbeMessage)); | 2529 | htons (sizeof (struct TCP_NAT_ProbeMessage)); |
2530 | tcp_probe_ctx->message.header.type = | 2530 | tcp_probe_ctx->message.header.type = |
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c index 5b46c93c7..a5ee6494a 100644 --- a/src/transport/plugin_transport_udp.c +++ b/src/transport/plugin_transport_udp.c | |||
@@ -684,7 +684,7 @@ udp_string_to_address (void *cls, const char *addr, uint16_t addrlen, | |||
684 | { | 684 | { |
685 | struct IPv4UdpAddress *u4; | 685 | struct IPv4UdpAddress *u4; |
686 | struct sockaddr_in *in4 = (struct sockaddr_in *) &socket_address; | 686 | struct sockaddr_in *in4 = (struct sockaddr_in *) &socket_address; |
687 | u4 = GNUNET_malloc (sizeof (struct IPv4UdpAddress)); | 687 | u4 = GNUNET_new (struct IPv4UdpAddress); |
688 | u4->options = htonl (options); | 688 | u4->options = htonl (options); |
689 | u4->ipv4_addr = in4->sin_addr.s_addr; | 689 | u4->ipv4_addr = in4->sin_addr.s_addr; |
690 | u4->u4_port = in4->sin_port; | 690 | u4->u4_port = in4->sin_port; |
@@ -696,7 +696,7 @@ udp_string_to_address (void *cls, const char *addr, uint16_t addrlen, | |||
696 | { | 696 | { |
697 | struct IPv6UdpAddress *u6; | 697 | struct IPv6UdpAddress *u6; |
698 | struct sockaddr_in6 *in6 = (struct sockaddr_in6 *) &socket_address; | 698 | struct sockaddr_in6 *in6 = (struct sockaddr_in6 *) &socket_address; |
699 | u6 = GNUNET_malloc (sizeof (struct IPv6UdpAddress)); | 699 | u6 = GNUNET_new (struct IPv6UdpAddress); |
700 | u6->options = htonl (options); | 700 | u6->options = htonl (options); |
701 | u6->ipv6_addr = in6->sin6_addr; | 701 | u6->ipv6_addr = in6->sin6_addr; |
702 | u6->u6_port = in6->sin6_port; | 702 | u6->u6_port = in6->sin6_port; |
@@ -1911,7 +1911,7 @@ udp_plugin_send (void *cls, | |||
1911 | if (s->frag_ctx != NULL) | 1911 | if (s->frag_ctx != NULL) |
1912 | return GNUNET_SYSERR; | 1912 | return GNUNET_SYSERR; |
1913 | memcpy (&udp[1], msgbuf, msgbuf_size); | 1913 | memcpy (&udp[1], msgbuf, msgbuf_size); |
1914 | frag_ctx = GNUNET_malloc (sizeof (struct UDP_FragmentationContext)); | 1914 | frag_ctx = GNUNET_new (struct UDP_FragmentationContext); |
1915 | frag_ctx->plugin = plugin; | 1915 | frag_ctx->plugin = plugin; |
1916 | frag_ctx->session = s; | 1916 | frag_ctx->session = s; |
1917 | frag_ctx->cont = cont; | 1917 | frag_ctx->cont = cont; |
diff --git a/src/transport/plugin_transport_udp_broadcasting.c b/src/transport/plugin_transport_udp_broadcasting.c index 61ac3d10e..5448b4eff 100644 --- a/src/transport/plugin_transport_udp_broadcasting.c +++ b/src/transport/plugin_transport_udp_broadcasting.c | |||
@@ -242,7 +242,7 @@ udp_broadcast_receive (struct Plugin *plugin, | |||
242 | size, GNUNET_a2s ((const struct sockaddr *) addr, addrlen)); | 242 | size, GNUNET_a2s ((const struct sockaddr *) addr, addrlen)); |
243 | struct Mstv4Context *mc; | 243 | struct Mstv4Context *mc; |
244 | 244 | ||
245 | mc = GNUNET_malloc (sizeof (struct Mstv4Context)); | 245 | mc = GNUNET_new (struct Mstv4Context); |
246 | struct sockaddr_in *av4 = (struct sockaddr_in *) addr; | 246 | struct sockaddr_in *av4 = (struct sockaddr_in *) addr; |
247 | 247 | ||
248 | mc->addr.ipv4_addr = av4->sin_addr.s_addr; | 248 | mc->addr.ipv4_addr = av4->sin_addr.s_addr; |
@@ -263,7 +263,7 @@ udp_broadcast_receive (struct Plugin *plugin, | |||
263 | size, GNUNET_a2s ((const struct sockaddr *) &addr, addrlen)); | 263 | size, GNUNET_a2s ((const struct sockaddr *) &addr, addrlen)); |
264 | struct Mstv6Context *mc; | 264 | struct Mstv6Context *mc; |
265 | 265 | ||
266 | mc = GNUNET_malloc (sizeof (struct Mstv6Context)); | 266 | mc = GNUNET_new (struct Mstv6Context); |
267 | struct sockaddr_in6 *av6 = (struct sockaddr_in6 *) addr; | 267 | struct sockaddr_in6 *av6 = (struct sockaddr_in6 *) addr; |
268 | 268 | ||
269 | mc->addr.ipv6_addr = av6->sin6_addr; | 269 | mc->addr.ipv6_addr = av6->sin6_addr; |
diff --git a/src/transport/plugin_transport_wlan.c b/src/transport/plugin_transport_wlan.c index 6f5c66ad3..1fafc4070 100644 --- a/src/transport/plugin_transport_wlan.c +++ b/src/transport/plugin_transport_wlan.c | |||
@@ -777,7 +777,7 @@ create_session (struct MacEndpoint *endpoint, | |||
777 | 777 | ||
778 | GNUNET_STATISTICS_update (endpoint->plugin->env->stats, _("# WLAN sessions allocated"), 1, | 778 | GNUNET_STATISTICS_update (endpoint->plugin->env->stats, _("# WLAN sessions allocated"), 1, |
779 | GNUNET_NO); | 779 | GNUNET_NO); |
780 | session = GNUNET_malloc (sizeof (struct Session)); | 780 | session = GNUNET_new (struct Session); |
781 | GNUNET_CONTAINER_DLL_insert_tail (endpoint->sessions_head, | 781 | GNUNET_CONTAINER_DLL_insert_tail (endpoint->sessions_head, |
782 | endpoint->sessions_tail, | 782 | endpoint->sessions_tail, |
783 | session); | 783 | session); |
@@ -974,7 +974,7 @@ send_with_fragmentation (struct MacEndpoint *endpoint, | |||
974 | struct Plugin *plugin; | 974 | struct Plugin *plugin; |
975 | 975 | ||
976 | plugin = endpoint->plugin; | 976 | plugin = endpoint->plugin; |
977 | fm = GNUNET_malloc (sizeof (struct FragmentMessage)); | 977 | fm = GNUNET_new (struct FragmentMessage); |
978 | fm->macendpoint = endpoint; | 978 | fm->macendpoint = endpoint; |
979 | fm->target = *target; | 979 | fm->target = *target; |
980 | fm->size_payload = payload_size; | 980 | fm->size_payload = payload_size; |
@@ -1079,7 +1079,7 @@ create_macendpoint (struct Plugin *plugin, | |||
1079 | for (pos = plugin->mac_head; NULL != pos; pos = pos->next) | 1079 | for (pos = plugin->mac_head; NULL != pos; pos = pos->next) |
1080 | if (0 == memcmp (addr, &pos->addr, sizeof (struct WlanAddress))) | 1080 | if (0 == memcmp (addr, &pos->addr, sizeof (struct WlanAddress))) |
1081 | return pos; | 1081 | return pos; |
1082 | pos = GNUNET_malloc (sizeof (struct MacEndpoint)); | 1082 | pos = GNUNET_new (struct MacEndpoint); |
1083 | pos->addr = *addr; | 1083 | pos->addr = *addr; |
1084 | pos->plugin = plugin; | 1084 | pos->plugin = plugin; |
1085 | pos->defrag = | 1085 | pos->defrag = |
@@ -1846,7 +1846,7 @@ wlan_string_to_address (void *cls, const char *addr, uint16_t addrlen, | |||
1846 | GNUNET_break (0); | 1846 | GNUNET_break (0); |
1847 | return GNUNET_SYSERR; | 1847 | return GNUNET_SYSERR; |
1848 | } | 1848 | } |
1849 | wa = GNUNET_malloc (sizeof (struct WlanAddress)); | 1849 | wa = GNUNET_new (struct WlanAddress); |
1850 | for (i=0;i<6;i++) | 1850 | for (i=0;i<6;i++) |
1851 | wa->mac.mac[i] = a[i]; | 1851 | wa->mac.mac[i] = a[i]; |
1852 | wa->options = htonl (0); | 1852 | wa->options = htonl (0); |
@@ -1889,7 +1889,7 @@ libgnunet_plugin_transport_wlan_init (void *cls) | |||
1889 | { | 1889 | { |
1890 | /* run in 'stub' mode (i.e. as part of gnunet-peerinfo), don't fully | 1890 | /* run in 'stub' mode (i.e. as part of gnunet-peerinfo), don't fully |
1891 | initialze the plugin or the API */ | 1891 | initialze the plugin or the API */ |
1892 | api = GNUNET_malloc (sizeof (struct GNUNET_TRANSPORT_PluginFunctions)); | 1892 | api = GNUNET_new (struct GNUNET_TRANSPORT_PluginFunctions); |
1893 | api->cls = NULL; | 1893 | api->cls = NULL; |
1894 | api->address_pretty_printer = &wlan_plugin_address_pretty_printer; | 1894 | api->address_pretty_printer = &wlan_plugin_address_pretty_printer; |
1895 | api->address_to_string = &wlan_plugin_address_to_string; | 1895 | api->address_to_string = &wlan_plugin_address_to_string; |
@@ -1931,7 +1931,7 @@ libgnunet_plugin_transport_wlan_init (void *cls) | |||
1931 | return NULL; | 1931 | return NULL; |
1932 | } | 1932 | } |
1933 | 1933 | ||
1934 | plugin = GNUNET_malloc (sizeof (struct Plugin)); | 1934 | plugin = GNUNET_new (struct Plugin); |
1935 | plugin->interface = interface; | 1935 | plugin->interface = interface; |
1936 | plugin->env = env; | 1936 | plugin->env = env; |
1937 | GNUNET_STATISTICS_set (plugin->env->stats, _("# WLAN sessions allocated"), | 1937 | GNUNET_STATISTICS_set (plugin->env->stats, _("# WLAN sessions allocated"), |
@@ -1989,7 +1989,7 @@ libgnunet_plugin_transport_wlan_init (void *cls) | |||
1989 | GNUNET_assert (0); | 1989 | GNUNET_assert (0); |
1990 | } | 1990 | } |
1991 | 1991 | ||
1992 | api = GNUNET_malloc (sizeof (struct GNUNET_TRANSPORT_PluginFunctions)); | 1992 | api = GNUNET_new (struct GNUNET_TRANSPORT_PluginFunctions); |
1993 | api->cls = plugin; | 1993 | api->cls = plugin; |
1994 | api->send = &wlan_plugin_send; | 1994 | api->send = &wlan_plugin_send; |
1995 | api->get_session = &wlan_plugin_get_session; | 1995 | api->get_session = &wlan_plugin_get_session; |
diff --git a/src/transport/transport-testing.c b/src/transport/transport-testing.c index 51aa0a55f..f9182b57f 100644 --- a/src/transport/transport-testing.c +++ b/src/transport/transport-testing.c | |||
@@ -246,7 +246,7 @@ GNUNET_TRANSPORT_TESTING_start_peer (struct GNUNET_TRANSPORT_TESTING_handle *tth | |||
246 | return NULL; | 246 | return NULL; |
247 | } | 247 | } |
248 | 248 | ||
249 | struct PeerContext *p = GNUNET_malloc (sizeof (struct PeerContext)); | 249 | struct PeerContext *p = GNUNET_new (struct PeerContext); |
250 | GNUNET_CONTAINER_DLL_insert (tth->p_head, tth->p_tail, p); | 250 | GNUNET_CONTAINER_DLL_insert (tth->p_head, tth->p_tail, p); |
251 | 251 | ||
252 | /* Create configuration and call testing lib to modify it */ | 252 | /* Create configuration and call testing lib to modify it */ |
@@ -471,7 +471,7 @@ GNUNET_TRANSPORT_TESTING_connect_peers (struct GNUNET_TRANSPORT_TESTING_handle * | |||
471 | GNUNET_assert (tth != NULL); | 471 | GNUNET_assert (tth != NULL); |
472 | 472 | ||
473 | struct ConnectingContext *cc = | 473 | struct ConnectingContext *cc = |
474 | GNUNET_malloc (sizeof (struct ConnectingContext)); | 474 | GNUNET_new (struct ConnectingContext); |
475 | 475 | ||
476 | GNUNET_assert (p1 != NULL); | 476 | GNUNET_assert (p1 != NULL); |
477 | GNUNET_assert (p2 != NULL); | 477 | GNUNET_assert (p2 != NULL); |
@@ -574,7 +574,7 @@ GNUNET_TRANSPORT_TESTING_init () | |||
574 | struct GNUNET_TRANSPORT_TESTING_handle *tth; | 574 | struct GNUNET_TRANSPORT_TESTING_handle *tth; |
575 | 575 | ||
576 | /* prepare hostkeys */ | 576 | /* prepare hostkeys */ |
577 | tth = GNUNET_malloc (sizeof (struct GNUNET_TRANSPORT_TESTING_handle)); | 577 | tth = GNUNET_new (struct GNUNET_TRANSPORT_TESTING_handle); |
578 | 578 | ||
579 | /* Init testing the testing lib */ | 579 | /* Init testing the testing lib */ |
580 | tth->tl_system = GNUNET_TESTING_system_create ("transport-testing", NULL, | 580 | tth->tl_system = GNUNET_TESTING_system_create ("transport-testing", NULL, |
diff --git a/src/transport/transport_api_address_lookup.c b/src/transport/transport_api_address_lookup.c index 515be9bf8..d547b8ed8 100644 --- a/src/transport/transport_api_address_lookup.c +++ b/src/transport/transport_api_address_lookup.c | |||
@@ -322,7 +322,7 @@ GNUNET_TRANSPORT_peer_get_active_addresses (const struct | |||
322 | return NULL; | 322 | return NULL; |
323 | if (GNUNET_YES != one_shot) | 323 | if (GNUNET_YES != one_shot) |
324 | timeout = GNUNET_TIME_UNIT_FOREVER_REL; | 324 | timeout = GNUNET_TIME_UNIT_FOREVER_REL; |
325 | pal_ctx = GNUNET_malloc (sizeof (struct GNUNET_TRANSPORT_PeerIterateContext)); | 325 | pal_ctx = GNUNET_new (struct GNUNET_TRANSPORT_PeerIterateContext); |
326 | pal_ctx->cb = peer_address_callback; | 326 | pal_ctx->cb = peer_address_callback; |
327 | pal_ctx->cb_cls = peer_address_callback_cls; | 327 | pal_ctx->cb_cls = peer_address_callback_cls; |
328 | pal_ctx->cfg = cfg; | 328 | pal_ctx->cfg = cfg; |
diff --git a/src/transport/transport_api_address_to_string.c b/src/transport/transport_api_address_to_string.c index 94c9ac45a..0fb0623dc 100644 --- a/src/transport/transport_api_address_to_string.c +++ b/src/transport/transport_api_address_to_string.c | |||
@@ -152,7 +152,7 @@ GNUNET_TRANSPORT_address_to_string (const struct GNUNET_CONFIGURATION_Handle | |||
152 | memcpy (addrbuf, address->address, alen); | 152 | memcpy (addrbuf, address->address, alen); |
153 | memcpy (&addrbuf[alen], address->transport_name, slen); | 153 | memcpy (&addrbuf[alen], address->transport_name, slen); |
154 | 154 | ||
155 | alc = GNUNET_malloc (sizeof (struct GNUNET_TRANSPORT_AddressToStringContext)); | 155 | alc = GNUNET_new (struct GNUNET_TRANSPORT_AddressToStringContext); |
156 | alc->cb = aluc; | 156 | alc->cb = aluc; |
157 | alc->cb_cls = aluc_cls; | 157 | alc->cb_cls = aluc_cls; |
158 | alc->timeout = GNUNET_TIME_relative_to_absolute (timeout); | 158 | alc->timeout = GNUNET_TIME_relative_to_absolute (timeout); |
diff --git a/src/transport/transport_api_blacklist.c b/src/transport/transport_api_blacklist.c index dcd1ae781..1c17bd498 100644 --- a/src/transport/transport_api_blacklist.c +++ b/src/transport/transport_api_blacklist.c | |||
@@ -256,7 +256,7 @@ GNUNET_TRANSPORT_blacklist (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
256 | client = GNUNET_CLIENT_connect ("transport", cfg); | 256 | client = GNUNET_CLIENT_connect ("transport", cfg); |
257 | if (NULL == client) | 257 | if (NULL == client) |
258 | return NULL; | 258 | return NULL; |
259 | ret = GNUNET_malloc (sizeof (struct GNUNET_TRANSPORT_Blacklist)); | 259 | ret = GNUNET_new (struct GNUNET_TRANSPORT_Blacklist); |
260 | ret->client = client; | 260 | ret->client = client; |
261 | ret->cfg = cfg; | 261 | ret->cfg = cfg; |
262 | ret->cb = cb; | 262 | ret->cb = cb; |
diff --git a/src/util/common_logging.c b/src/util/common_logging.c index 582435651..a2338f1c9 100644 --- a/src/util/common_logging.c +++ b/src/util/common_logging.c | |||
@@ -710,7 +710,7 @@ GNUNET_logger_add (GNUNET_Logger logger, void *logger_cls) | |||
710 | { | 710 | { |
711 | struct CustomLogger *entry; | 711 | struct CustomLogger *entry; |
712 | 712 | ||
713 | entry = GNUNET_malloc (sizeof (struct CustomLogger)); | 713 | entry = GNUNET_new (struct CustomLogger); |
714 | entry->logger = logger; | 714 | entry->logger = logger; |
715 | entry->logger_cls = logger_cls; | 715 | entry->logger_cls = logger_cls; |
716 | entry->next = loggers; | 716 | entry->next = loggers; |
diff --git a/src/util/container_bloomfilter.c b/src/util/container_bloomfilter.c index 645729553..9554e0ec0 100644 --- a/src/util/container_bloomfilter.c +++ b/src/util/container_bloomfilter.c | |||
@@ -494,7 +494,7 @@ GNUNET_CONTAINER_bloomfilter_load (const char *filename, size_t size, | |||
494 | ui *= 2; | 494 | ui *= 2; |
495 | size = ui; /* make sure it's a power of 2 */ | 495 | size = ui; /* make sure it's a power of 2 */ |
496 | 496 | ||
497 | bf = GNUNET_malloc (sizeof (struct GNUNET_CONTAINER_BloomFilter)); | 497 | bf = GNUNET_new (struct GNUNET_CONTAINER_BloomFilter); |
498 | /* Try to open a bloomfilter file */ | 498 | /* Try to open a bloomfilter file */ |
499 | if (GNUNET_YES == GNUNET_DISK_file_test (filename)) | 499 | if (GNUNET_YES == GNUNET_DISK_file_test (filename)) |
500 | bf->fh = | 500 | bf->fh = |
@@ -631,7 +631,7 @@ GNUNET_CONTAINER_bloomfilter_init (const char *data, size_t size, | |||
631 | 631 | ||
632 | if ((0 == k) || (0 == size)) | 632 | if ((0 == k) || (0 == size)) |
633 | return NULL; | 633 | return NULL; |
634 | bf = GNUNET_malloc (sizeof (struct GNUNET_CONTAINER_BloomFilter)); | 634 | bf = GNUNET_new (struct GNUNET_CONTAINER_BloomFilter); |
635 | bf->filename = NULL; | 635 | bf->filename = NULL; |
636 | bf->fh = NULL; | 636 | bf->fh = NULL; |
637 | bf->bitArray = GNUNET_malloc_large (size); | 637 | bf->bitArray = GNUNET_malloc_large (size); |
diff --git a/src/util/container_heap.c b/src/util/container_heap.c index 0f63f957d..54da89f7a 100644 --- a/src/util/container_heap.c +++ b/src/util/container_heap.c | |||
@@ -142,7 +142,7 @@ GNUNET_CONTAINER_heap_create (enum GNUNET_CONTAINER_HeapOrder order) | |||
142 | { | 142 | { |
143 | struct GNUNET_CONTAINER_Heap *heap; | 143 | struct GNUNET_CONTAINER_Heap *heap; |
144 | 144 | ||
145 | heap = GNUNET_malloc (sizeof (struct GNUNET_CONTAINER_Heap)); | 145 | heap = GNUNET_new (struct GNUNET_CONTAINER_Heap); |
146 | heap->order = order; | 146 | heap->order = order; |
147 | return heap; | 147 | return heap; |
148 | } | 148 | } |
@@ -351,7 +351,7 @@ GNUNET_CONTAINER_heap_insert (struct GNUNET_CONTAINER_Heap *heap, void *element, | |||
351 | { | 351 | { |
352 | struct GNUNET_CONTAINER_HeapNode *node; | 352 | struct GNUNET_CONTAINER_HeapNode *node; |
353 | 353 | ||
354 | node = GNUNET_malloc (sizeof (struct GNUNET_CONTAINER_HeapNode)); | 354 | node = GNUNET_new (struct GNUNET_CONTAINER_HeapNode); |
355 | node->heap = heap; | 355 | node->heap = heap; |
356 | node->element = element; | 356 | node->element = element; |
357 | node->cost = cost; | 357 | node->cost = cost; |
diff --git a/src/util/container_slist.c b/src/util/container_slist.c index 10af916c3..e75c695c5 100644 --- a/src/util/container_slist.c +++ b/src/util/container_slist.c | |||
@@ -101,7 +101,7 @@ create_elem (enum GNUNET_CONTAINER_SListDisposition disp, const void *buf, | |||
101 | } | 101 | } |
102 | else | 102 | else |
103 | { | 103 | { |
104 | e = GNUNET_malloc (sizeof (struct GNUNET_CONTAINER_SList_Elem)); | 104 | e = GNUNET_new (struct GNUNET_CONTAINER_SList_Elem); |
105 | e->elem = (void *) buf; | 105 | e->elem = (void *) buf; |
106 | } | 106 | } |
107 | e->disp = disp; | 107 | e->disp = disp; |
@@ -190,7 +190,7 @@ GNUNET_CONTAINER_slist_append (struct GNUNET_CONTAINER_SList *dst, | |||
190 | struct GNUNET_CONTAINER_SList * | 190 | struct GNUNET_CONTAINER_SList * |
191 | GNUNET_CONTAINER_slist_create () | 191 | GNUNET_CONTAINER_slist_create () |
192 | { | 192 | { |
193 | return GNUNET_malloc (sizeof (struct GNUNET_CONTAINER_SList)); | 193 | return GNUNET_new (struct GNUNET_CONTAINER_SList); |
194 | } | 194 | } |
195 | 195 | ||
196 | 196 | ||
diff --git a/src/util/disk.c b/src/util/disk.c index 074355c0a..aac730eec 100644 --- a/src/util/disk.c +++ b/src/util/disk.c | |||
@@ -1899,8 +1899,8 @@ GNUNET_DISK_get_handle_from_w32_handle (HANDLE osfh) | |||
1899 | * otherwise we're screwed, as selecting on non-overlapped handle | 1899 | * otherwise we're screwed, as selecting on non-overlapped handle |
1900 | * will block. | 1900 | * will block. |
1901 | */ | 1901 | */ |
1902 | fh->oOverlapRead = GNUNET_malloc (sizeof (OVERLAPPED)); | 1902 | fh->oOverlapRead = GNUNET_new (OVERLAPPED); |
1903 | fh->oOverlapWrite = GNUNET_malloc (sizeof (OVERLAPPED)); | 1903 | fh->oOverlapWrite = GNUNET_new (OVERLAPPED); |
1904 | fh->oOverlapRead->hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); | 1904 | fh->oOverlapRead->hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); |
1905 | fh->oOverlapWrite->hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); | 1905 | fh->oOverlapWrite->hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); |
1906 | } | 1906 | } |
@@ -2356,10 +2356,10 @@ GNUNET_DISK_pipe (int blocking_read, int blocking_write, int inherit_read, int i | |||
2356 | p->fd[0]->type = GNUNET_DISK_HANLDE_TYPE_PIPE; | 2356 | p->fd[0]->type = GNUNET_DISK_HANLDE_TYPE_PIPE; |
2357 | p->fd[1]->type = GNUNET_DISK_HANLDE_TYPE_PIPE; | 2357 | p->fd[1]->type = GNUNET_DISK_HANLDE_TYPE_PIPE; |
2358 | 2358 | ||
2359 | p->fd[0]->oOverlapRead = GNUNET_malloc (sizeof (OVERLAPPED)); | 2359 | p->fd[0]->oOverlapRead = GNUNET_new (OVERLAPPED); |
2360 | p->fd[0]->oOverlapWrite = GNUNET_malloc (sizeof (OVERLAPPED)); | 2360 | p->fd[0]->oOverlapWrite = GNUNET_new (OVERLAPPED); |
2361 | p->fd[1]->oOverlapRead = GNUNET_malloc (sizeof (OVERLAPPED)); | 2361 | p->fd[1]->oOverlapRead = GNUNET_new (OVERLAPPED); |
2362 | p->fd[1]->oOverlapWrite = GNUNET_malloc (sizeof (OVERLAPPED)); | 2362 | p->fd[1]->oOverlapWrite = GNUNET_new (OVERLAPPED); |
2363 | 2363 | ||
2364 | p->fd[0]->oOverlapRead->hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); | 2364 | p->fd[0]->oOverlapRead->hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); |
2365 | p->fd[0]->oOverlapWrite->hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); | 2365 | p->fd[0]->oOverlapWrite->hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); |
@@ -2462,8 +2462,8 @@ GNUNET_DISK_pipe_from_fd (int blocking_read, int blocking_write, int fd[2]) | |||
2462 | if (p->fd[0]->h != INVALID_HANDLE_VALUE) | 2462 | if (p->fd[0]->h != INVALID_HANDLE_VALUE) |
2463 | { | 2463 | { |
2464 | p->fd[0]->type = GNUNET_DISK_HANLDE_TYPE_PIPE; | 2464 | p->fd[0]->type = GNUNET_DISK_HANLDE_TYPE_PIPE; |
2465 | p->fd[0]->oOverlapRead = GNUNET_malloc (sizeof (OVERLAPPED)); | 2465 | p->fd[0]->oOverlapRead = GNUNET_new (OVERLAPPED); |
2466 | p->fd[0]->oOverlapWrite = GNUNET_malloc (sizeof (OVERLAPPED)); | 2466 | p->fd[0]->oOverlapWrite = GNUNET_new (OVERLAPPED); |
2467 | p->fd[0]->oOverlapRead->hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); | 2467 | p->fd[0]->oOverlapRead->hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); |
2468 | p->fd[0]->oOverlapWrite->hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); | 2468 | p->fd[0]->oOverlapWrite->hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); |
2469 | } | 2469 | } |
@@ -2480,8 +2480,8 @@ GNUNET_DISK_pipe_from_fd (int blocking_read, int blocking_write, int fd[2]) | |||
2480 | if (p->fd[1]->h != INVALID_HANDLE_VALUE) | 2480 | if (p->fd[1]->h != INVALID_HANDLE_VALUE) |
2481 | { | 2481 | { |
2482 | p->fd[1]->type = GNUNET_DISK_HANLDE_TYPE_PIPE; | 2482 | p->fd[1]->type = GNUNET_DISK_HANLDE_TYPE_PIPE; |
2483 | p->fd[1]->oOverlapRead = GNUNET_malloc (sizeof (OVERLAPPED)); | 2483 | p->fd[1]->oOverlapRead = GNUNET_new (OVERLAPPED); |
2484 | p->fd[1]->oOverlapWrite = GNUNET_malloc (sizeof (OVERLAPPED)); | 2484 | p->fd[1]->oOverlapWrite = GNUNET_new (OVERLAPPED); |
2485 | p->fd[1]->oOverlapRead->hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); | 2485 | p->fd[1]->oOverlapRead->hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); |
2486 | p->fd[1]->oOverlapWrite->hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); | 2486 | p->fd[1]->oOverlapWrite->hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); |
2487 | } | 2487 | } |
diff --git a/src/util/os_priority.c b/src/util/os_priority.c index ab82b7b58..2cabd214e 100644 --- a/src/util/os_priority.c +++ b/src/util/os_priority.c | |||
@@ -1089,7 +1089,7 @@ start_process (int pipe_control, | |||
1089 | return NULL; | 1089 | return NULL; |
1090 | } | 1090 | } |
1091 | 1091 | ||
1092 | gnunet_proc = GNUNET_malloc (sizeof (struct GNUNET_OS_Process)); | 1092 | gnunet_proc = GNUNET_new (struct GNUNET_OS_Process); |
1093 | gnunet_proc->pid = proc.dwProcessId; | 1093 | gnunet_proc->pid = proc.dwProcessId; |
1094 | gnunet_proc->handle = proc.hProcess; | 1094 | gnunet_proc->handle = proc.hProcess; |
1095 | gnunet_proc->control_pipe = childpipe_write; | 1095 | gnunet_proc->control_pipe = childpipe_write; |
@@ -1774,7 +1774,7 @@ GNUNET_OS_command_run (GNUNET_OS_LineProcessor proc, void *proc_cls, | |||
1774 | return NULL; | 1774 | return NULL; |
1775 | } | 1775 | } |
1776 | GNUNET_DISK_pipe_close_end (opipe, GNUNET_DISK_PIPE_END_WRITE); | 1776 | GNUNET_DISK_pipe_close_end (opipe, GNUNET_DISK_PIPE_END_WRITE); |
1777 | cmd = GNUNET_malloc (sizeof (struct GNUNET_OS_CommandHandle)); | 1777 | cmd = GNUNET_new (struct GNUNET_OS_CommandHandle); |
1778 | cmd->timeout = GNUNET_TIME_relative_to_absolute (timeout); | 1778 | cmd->timeout = GNUNET_TIME_relative_to_absolute (timeout); |
1779 | cmd->eip = eip; | 1779 | cmd->eip = eip; |
1780 | cmd->opipe = opipe; | 1780 | cmd->opipe = opipe; |
diff --git a/src/util/peer.c b/src/util/peer.c index fa376d333..3e4e1712d 100644 --- a/src/util/peer.c +++ b/src/util/peer.c | |||
@@ -127,7 +127,7 @@ GNUNET_PEER_intern (const struct GNUNET_PeerIdentity *pid) | |||
127 | GNUNET_array_grow (table, size, size + 16); | 127 | GNUNET_array_grow (table, size, size + 16); |
128 | for (i = ret; i < size; i++) | 128 | for (i = ret; i < size; i++) |
129 | { | 129 | { |
130 | table[i] = GNUNET_malloc (sizeof (struct PeerEntry)); | 130 | table[i] = GNUNET_new (struct PeerEntry); |
131 | table[i]->pid = i + 1; | 131 | table[i]->pid = i + 1; |
132 | } | 132 | } |
133 | } | 133 | } |
diff --git a/src/util/server_tc.c b/src/util/server_tc.c index 780b5f003..5324a6ab9 100644 --- a/src/util/server_tc.c +++ b/src/util/server_tc.c | |||
@@ -127,7 +127,7 @@ GNUNET_SERVER_transmit_context_create (struct GNUNET_SERVER_Client *client) | |||
127 | struct GNUNET_SERVER_TransmitContext *tc; | 127 | struct GNUNET_SERVER_TransmitContext *tc; |
128 | 128 | ||
129 | GNUNET_assert (NULL != client); | 129 | GNUNET_assert (NULL != client); |
130 | tc = GNUNET_malloc (sizeof (struct GNUNET_SERVER_TransmitContext)); | 130 | tc = GNUNET_new (struct GNUNET_SERVER_TransmitContext); |
131 | GNUNET_SERVER_client_keep (client); | 131 | GNUNET_SERVER_client_keep (client); |
132 | tc->client = client; | 132 | tc->client = client; |
133 | return tc; | 133 | return tc; |
diff --git a/src/util/signal.c b/src/util/signal.c index 5cf50e8dc..b76c658c8 100644 --- a/src/util/signal.c +++ b/src/util/signal.c | |||
@@ -64,7 +64,7 @@ GNUNET_SIGNAL_handler_install (int signum, GNUNET_SIGNAL_Handler handler) | |||
64 | struct sigaction sig; | 64 | struct sigaction sig; |
65 | #endif | 65 | #endif |
66 | 66 | ||
67 | ret = GNUNET_malloc (sizeof (struct GNUNET_SIGNAL_Context)); | 67 | ret = GNUNET_new (struct GNUNET_SIGNAL_Context); |
68 | ret->sig = signum; | 68 | ret->sig = signum; |
69 | ret->method = handler; | 69 | ret->method = handler; |
70 | #ifndef MINGW | 70 | #ifndef MINGW |
diff --git a/src/util/test_client.c b/src/util/test_client.c index 6dfb8349a..2b44c1690 100644 --- a/src/util/test_client.c +++ b/src/util/test_client.c | |||
@@ -73,7 +73,7 @@ echo_cb (void *cls, struct GNUNET_SERVER_Client *client, | |||
73 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 73 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
74 | "Receiving message from client, bouncing back\n"); | 74 | "Receiving message from client, bouncing back\n"); |
75 | GNUNET_assert (sizeof (struct GNUNET_MessageHeader) == ntohs (message->size)); | 75 | GNUNET_assert (sizeof (struct GNUNET_MessageHeader) == ntohs (message->size)); |
76 | cc = GNUNET_malloc (sizeof (struct CopyContext)); | 76 | cc = GNUNET_new (struct CopyContext); |
77 | cc->client = client; | 77 | cc->client = client; |
78 | cpy = GNUNET_malloc (ntohs (message->size)); | 78 | cpy = GNUNET_malloc (ntohs (message->size)); |
79 | memcpy (cpy, message, ntohs (message->size)); | 79 | memcpy (cpy, message, ntohs (message->size)); |
diff --git a/src/util/test_container_slist.c b/src/util/test_container_slist.c index 8b4ff93d0..443d5c7c5 100644 --- a/src/util/test_container_slist.c +++ b/src/util/test_container_slist.c | |||
@@ -136,7 +136,7 @@ main (int argc, char *argv[]) | |||
136 | 136 | ||
137 | for (i = 0; i < 100; i++) | 137 | for (i = 0; i < 100; i++) |
138 | { | 138 | { |
139 | ip = GNUNET_malloc (sizeof (int)); | 139 | ip = GNUNET_new (int); |
140 | *ip = i; | 140 | *ip = i; |
141 | GNUNET_CONTAINER_slist_add (l, GNUNET_CONTAINER_SLIST_DISPOSITION_DYNAMIC, | 141 | GNUNET_CONTAINER_slist_add (l, GNUNET_CONTAINER_SLIST_DISPOSITION_DYNAMIC, |
142 | ip, sizeof (int)); | 142 | ip, sizeof (int)); |