diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2014-06-23 14:33:55 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2014-06-23 14:33:55 +0000 |
commit | 565e3643dd3f12fc275d2fb0f7642b17afd00691 (patch) | |
tree | b13c6cb517c9fdc5d6364121b53908ce83afd709 /winsup/cygwin/regex/regcomp.c | |
parent | f83cc3b7e9724276429d2f74705993eedacf0b43 (diff) | |
download | cygnal-565e3643dd3f12fc275d2fb0f7642b17afd00691.tar.gz cygnal-565e3643dd3f12fc275d2fb0f7642b17afd00691.tar.bz2 cygnal-565e3643dd3f12fc275d2fb0f7642b17afd00691.zip |
* regex/regcomp.c (computematchjumps): Free local memory in case of
error (CID 59975).
Diffstat (limited to 'winsup/cygwin/regex/regcomp.c')
-rw-r--r-- | winsup/cygwin/regex/regcomp.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/winsup/cygwin/regex/regcomp.c b/winsup/cygwin/regex/regcomp.c index b68db99c7..d68dcc32a 100644 --- a/winsup/cygwin/regex/regcomp.c +++ b/winsup/cygwin/regex/regcomp.c @@ -1803,7 +1803,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 */ + { + free (pmatches); return; + } /* Set maximum possible jump for each character in the pattern */ for (mindex = 0; mindex < g->mlen; mindex++) |