Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2014-06-23 18:33:55 +0400
committerCorinna Vinschen <corinna@vinschen.de>2014-06-23 18:33:55 +0400
commit565e3643dd3f12fc275d2fb0f7642b17afd00691 (patch)
treeb13c6cb517c9fdc5d6364121b53908ce83afd709 /winsup/cygwin/regex
parentf83cc3b7e9724276429d2f74705993eedacf0b43 (diff)
* regex/regcomp.c (computematchjumps): Free local memory in case of
error (CID 59975).
Diffstat (limited to 'winsup/cygwin/regex')
-rw-r--r--winsup/cygwin/regex/regcomp.c3
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++)