aboutsummaryrefslogtreecommitdiffstats
path: root/regcomp.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2015-04-13 10:56:48 +0300
committerArnold D. Robbins <arnold@skeeve.com>2015-04-13 10:56:48 +0300
commit06a351f8774409db0d9c72ac4a51652f7c855c06 (patch)
tree2d881ae0c120539dc57c597e04cdf7d1b10cefd4 /regcomp.c
parent894bf983b22e22e46c1df0460a6f215ca21fc76e (diff)
parent0325b4daf737414c3b811b05c70b897b807a436b (diff)
downloadegawk-06a351f8774409db0d9c72ac4a51652f7c855c06.tar.gz
egawk-06a351f8774409db0d9c72ac4a51652f7c855c06.tar.bz2
egawk-06a351f8774409db0d9c72ac4a51652f7c855c06.zip
Merge branch 'gawk-4.1-stable'
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/regcomp.c b/regcomp.c
index f58cb091..3526d9ea 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -1205,7 +1205,12 @@ analyze (regex_t *preg)
|| dfa->eclosures == NULL, 0))
return REG_ESPACE;
- dfa->subexp_map = re_malloc (int, preg->re_nsub);
+ /* some malloc()-checkers don't like zero allocations */
+ if (preg->re_nsub > 0)
+ dfa->subexp_map = re_malloc (int, preg->re_nsub);
+ else
+ dfa->subexp_map = NULL;
+
if (dfa->subexp_map != NULL)
{
int i;