diff --git a/usr.bin/grep/regex/tre-fastmatch.c b/usr.bin/grep/regex/tre-fastmatch.c index da242842a0d3..5c659b09f48e 100644 --- a/usr.bin/grep/regex/tre-fastmatch.c +++ b/usr.bin/grep/regex/tre-fastmatch.c @@ -715,7 +715,7 @@ tre_compile_fast(fastmatch_t *fg, const tre_char_t *pat, size_t n, if (fg->wescmap != NULL) { fg->escmap = calloc(fg->len, sizeof(bool)); - if (fg->escmap != NULL) + if (fg->escmap == NULL) { tre_free_fast(fg); return REG_ESPACE;