diff options
author | LRN <lrn1986@gmail.com> | 2013-12-19 06:00:23 +0000 |
---|---|---|
committer | LRN <lrn1986@gmail.com> | 2013-12-19 06:00:23 +0000 |
commit | e0ca7357cd0bfedc5c29cb731b56279fef8da059 (patch) | |
tree | ecfd47cf59bc00e656b53fd59c58f5038e342d65 /src/regex/regex_test_lib.c | |
parent | 92fd84dc7ef98452f848a62677c61a2b80b5835e (diff) |
malloc -> new
Diffstat (limited to 'src/regex/regex_test_lib.c')
-rw-r--r-- | src/regex/regex_test_lib.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/regex/regex_test_lib.c b/src/regex/regex_test_lib.c index 09d608e659..2f3abdc65b 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) len = strlen (p->s); if (prefix_l < len) /* only partial match, split existing state */ { - newctx = GNUNET_malloc (sizeof (struct RegexCombineCtx)); + newctx = GNUNET_new (struct RegexCombineCtx); newctx->head = p->head; newctx->tail = p->tail; newctx->s = GNUNET_malloc(len - prefix_l + 1); @@ -262,14 +262,14 @@ regex_add (struct RegexCombineCtx *ctx, const char *regex) if (NULL == ctx->head && NULL != ctx->s) { /* this was the end before, add empty string */ - newctx = GNUNET_malloc (sizeof (struct RegexCombineCtx)); + newctx = GNUNET_new (struct RegexCombineCtx); newctx->s = GNUNET_strdup (""); GNUNET_CONTAINER_DLL_insert (ctx->head, ctx->tail, newctx); } GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " no match\n"); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " new state %s\n", regex); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " under %s\n", ctx->s); - newctx = GNUNET_malloc (sizeof (struct RegexCombineCtx)); + newctx = GNUNET_new (struct RegexCombineCtx); newctx->s = GNUNET_strdup (regex); GNUNET_CONTAINER_DLL_insert (ctx->head, ctx->tail, newctx); } @@ -312,7 +312,7 @@ REGEX_TEST_combine (char * const regexes[]) const char *current; struct RegexCombineCtx *ctx; - ctx = GNUNET_malloc (sizeof (struct RegexCombineCtx)); + ctx = GNUNET_new (struct RegexCombineCtx); for (i = 0; regexes[i]; i++) { current = regexes[i]; |