diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2014-06-23 18:33:55 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2014-06-23 18:33:55 +0400 |
commit | 565e3643dd3f12fc275d2fb0f7642b17afd00691 (patch) | |
tree | b13c6cb517c9fdc5d6364121b53908ce83afd709 /winsup | |
parent | f83cc3b7e9724276429d2f74705993eedacf0b43 (diff) |
* regex/regcomp.c (computematchjumps): Free local memory in case of
error (CID 59975).
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/regex/regcomp.c | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index d12f6f855..77a612418 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,10 @@ 2014-06-23 Corinna Vinschen <corinna@vinschen.de> + * regex/regcomp.c (computematchjumps): Free local memory in case of + error (CID 59975). + +2014-06-23 Corinna Vinschen <corinna@vinschen.de> + * mount.cc (fs_info::update): Define dir in the outermost scope to avoid accessing out-of-scope value (CID 60027). Always initialize attr to upath (CID 60113). 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++) |