From: Christian Grothoff Date: Fri, 5 Jan 2018 19:56:35 +0000 (+0100) Subject: fix signed/unsigned cmp X-Git-Tag: gnunet-0.11.0rc0~8 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=477e0dec4d6e9a51af2258611f45adea319ff6ae;p=oweals%2Fgnunet.git fix signed/unsigned cmp --- 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; }