struct REGEX_INTERNAL_Announcement *h;
GNUNET_assert (NULL != dht);
- h = GNUNET_malloc (sizeof (struct REGEX_INTERNAL_Announcement));
+ h = GNUNET_new (struct REGEX_INTERNAL_Announcement);
h->regex = regex;
h->dht = dht;
h->stats = stats;
}
hash = &ctx->hash;
- new_ctx = GNUNET_malloc (sizeof (struct RegexSearchContext));
+ new_ctx = GNUNET_new (struct RegexSearchContext);
new_ctx->info = info;
new_ctx->position = ctx->position + ctx->longest_match;
GNUNET_array_append (info->contexts, info->n_contexts, new_ctx);
LOG (GNUNET_ERROR_TYPE_INFO, "REGEX_INTERNAL_search: %s\n", string);
GNUNET_assert (NULL != dht);
GNUNET_assert (NULL != callback);
- h = GNUNET_malloc (sizeof (struct REGEX_INTERNAL_Search));
+ h = GNUNET_new (struct REGEX_INTERNAL_Search);
h->dht = dht;
h->description = GNUNET_strdup (string);
h->callback = callback;
LOG (GNUNET_ERROR_TYPE_INFO,
" initial key for %s: %s (%.*s)\n",
string, GNUNET_h2s (&key), size, string);
- ctx = GNUNET_malloc (sizeof (struct RegexSearchContext));
+ ctx = GNUNET_new (struct RegexSearchContext);
ctx->position = size;
ctx->info = h;
GNUNET_array_append (h->contexts, h->n_contexts, ctx);