diff options
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 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]; |