From 12eb0bca33b2879e0064077c68ef84e9744db6c1 Mon Sep 17 00:00:00 2001 From: "Pedro F. Giffuni" Date: Wed, 22 Apr 2015 17:09:02 +0000 Subject: [PATCH] computematchjumps(): fix allocator sizeof operand mismatch. Mostly cosmetical warning. Found by: Clang static analyzer --- lib/libc/regex/regcomp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/regex/regcomp.c b/lib/libc/regex/regcomp.c index 2da50666b5d..2f2d827ba83 100644 --- a/lib/libc/regex/regcomp.c +++ b/lib/libc/regex/regcomp.c @@ -1726,13 +1726,13 @@ computematchjumps(struct parse *p, struct re_guts *g) if (p->error != 0) return; - pmatches = (int*) malloc(g->mlen * sizeof(unsigned int)); + pmatches = (int*) malloc(g->mlen * sizeof(int)); if (pmatches == NULL) { g->matchjump = NULL; return; } - g->matchjump = (int*) malloc(g->mlen * sizeof(unsigned int)); + g->matchjump = (int*) malloc(g->mlen * sizeof(int)); if (g->matchjump == NULL) { /* Not a fatal error */ free(pmatches); return;