diff --git a/usr.bin/grep/regex/tre-fastmatch.c b/usr.bin/grep/regex/tre-fastmatch.c index bf59b9f8d551..6bf7c446529e 100644 --- a/usr.bin/grep/regex/tre-fastmatch.c +++ b/usr.bin/grep/regex/tre-fastmatch.c @@ -351,7 +351,7 @@ static int fastcmp(const fastmatch_t *fg, const void *data, #define FILL_BMGS \ if (fg->len > 0 && !fg->hasdot) \ { \ - fg->sbmGs = malloc(fg->len * sizeof(int)); \ + fg->sbmGs = malloc(fg->len * sizeof(*fg->sbmGs)); \ if (!fg->sbmGs) \ return REG_ESPACE; \ if (fg->len == 1) \ @@ -367,7 +367,7 @@ static int fastcmp(const fastmatch_t *fg, const void *data, #define FILL_BMGS_WIDE \ if (fg->wlen > 0 && !fg->hasdot) \ { \ - fg->bmGs = malloc(fg->wlen * sizeof(int)); \ + fg->bmGs = malloc(fg->wlen * sizeof(*fg->bmGs)); \ if (!fg->bmGs) \ return REG_ESPACE; \ if (fg->wlen == 1) \