diff options
| author | Xin LI <delphij@FreeBSD.org> | 2015-01-02 18:52:18 +0000 |
|---|---|---|
| committer | Xin LI <delphij@FreeBSD.org> | 2015-01-02 18:52:18 +0000 |
| commit | 9c24ccf54aebdb173a53fec932c10f91dca106c5 (patch) | |
| tree | cd319ded199c75e927de3c8340ff0f33b0530331 /lib/libc | |
| parent | dce9e6ba75da7d088f2660aed5b18e3582360bcb (diff) | |
Notes
Diffstat (limited to 'lib/libc')
| -rw-r--r-- | lib/libc/regex/regcomp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/regex/regcomp.c b/lib/libc/regex/regcomp.c index 985afedc3dc4..7bb8b552f991 100644 --- a/lib/libc/regex/regcomp.c +++ b/lib/libc/regex/regcomp.c @@ -1693,8 +1693,10 @@ computematchjumps(struct parse *p, struct re_guts *g) } g->matchjump = (int*) malloc(g->mlen * sizeof(unsigned int)); - if (g->matchjump == NULL) /* Not a fatal error */ + if (g->matchjump == NULL) { /* Not a fatal error */ + free(pmatches); return; + } /* Set maximum possible jump for each character in the pattern */ for (mindex = 0; mindex < g->mlen; mindex++) |
