From 477e0dec4d6e9a51af2258611f45adea319ff6ae Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 5 Jan 2018 20:56:35 +0100 Subject: [PATCH] fix signed/unsigned cmp --- src/regex/regex_test_lib.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/regex/regex_test_lib.c b/src/regex/regex_test_lib.c index f4025f652..4e388a70b 100644 --- a/src/regex/regex_test_lib.c +++ b/src/regex/regex_test_lib.c @@ -164,14 +164,18 @@ new_regex_ctx (unsigned int alphabet_size) return ctx; } + static void -move_children (struct RegexCombineCtx *dst, const struct RegexCombineCtx *src) +move_children (struct RegexCombineCtx *dst, + const struct RegexCombineCtx *src) { size_t array_size; array_size = sizeof(struct RegexCombineCtx *) * src->size; - memcpy (dst->children, src->children, array_size); - for (int i = 0; i < src->size; i++) + memcpy (dst->children, + src->children, + array_size); + for (unsigned int i = 0; i < src->size; i++) { src->children[i] = NULL; } @@ -402,6 +406,7 @@ regex_split (struct RegexCombineCtx *ctx, tmp = ctx->children; ctx->children = GNUNET_malloc (sizeof(*tmp) * ctx->size); regex_add_multiple (ctx, suffix, tmp); + GNUNET_free (suffix); GNUNET_free (tmp); return; } -- 2.25.1