summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2015-01-02 18:52:18 +0000
committerXin LI <delphij@FreeBSD.org>2015-01-02 18:52:18 +0000
commit9c24ccf54aebdb173a53fec932c10f91dca106c5 (patch)
treecd319ded199c75e927de3c8340ff0f33b0530331 /lib/libc
parentdce9e6ba75da7d088f2660aed5b18e3582360bcb (diff)
Notes
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/regex/regcomp.c4
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++)