diff options
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/less/regexp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/less/regexp.c b/usr.bin/less/regexp.c index 8d221ae1d0d..9fd72e1991d 100644 --- a/usr.bin/less/regexp.c +++ b/usr.bin/less/regexp.c @@ -242,8 +242,10 @@ char *exp; regnpar = 1; regcode = r->program; regc(MAGIC); - if (reg(0, &flags) == NULL) + if (reg(0, &flags) == NULL) { + free(r); return(NULL); + } /* Dig out information for optimizations. */ r->regstart = '\0'; /* Worst-case defaults. */ |