diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2014-06-22 22:08:14 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2014-06-22 22:08:14 +0300 |
commit | 78ded8ee8f11a321c96417e7d02dac2f5723a221 (patch) | |
tree | 5a083d41c5c496228a26e5081d281941f4414f60 /regcomp.c | |
parent | 9180926c14842c03fd3baa5b3f27ac1c5bb11924 (diff) | |
parent | 57454ce9249bdfea6451c231858e6a8b5d26c775 (diff) | |
download | egawk-78ded8ee8f11a321c96417e7d02dac2f5723a221.tar.gz egawk-78ded8ee8f11a321c96417e7d02dac2f5723a221.tar.bz2 egawk-78ded8ee8f11a321c96417e7d02dac2f5723a221.zip |
Merge branch 'gawk-4.1-stable'
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -2476,14 +2476,22 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token, while (token->type == OP_DUP_ASTERISK || token->type == OP_DUP_PLUS || token->type == OP_DUP_QUESTION || token->type == OP_OPEN_DUP_NUM) { - tree = parse_dup_op (tree, regexp, dfa, token, syntax, err); - if (BE (*err != REG_NOERROR && tree == NULL, 0)) - return NULL; + bin_tree_t *dup_tree = parse_dup_op (tree, regexp, dfa, token, + syntax, err); + if (BE (*err != REG_NOERROR && dup_tree == NULL, 0)) + { + if (tree != NULL) + postorder (tree, free_tree, NULL); + return NULL; + } + tree = dup_tree; /* In BRE consecutive duplications are not allowed. */ if ((syntax & RE_CONTEXT_INVALID_DUP) && (token->type == OP_DUP_ASTERISK || token->type == OP_OPEN_DUP_NUM)) { + if (tree != NULL) + postorder (tree, free_tree, NULL); *err = REG_BADRPT; return NULL; } |