aboutsummaryrefslogtreecommitdiffstats
path: root/support/regex_internal.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2022-03-25 14:01:33 +0300
committerArnold D. Robbins <arnold@skeeve.com>2022-03-25 14:01:33 +0300
commit0cdb4a0e28663cde0937601d26789ba5a6697848 (patch)
tree38b8cf2fe44abca8933afc66c647a3b6fe9e01cd /support/regex_internal.c
parentde585a8e18b29fb83c755df5f10029fd78cca7ed (diff)
parent6739849e21c5bfd849b0c4029c2950902e7656af (diff)
downloadegawk-0cdb4a0e28663cde0937601d26789ba5a6697848.tar.gz
egawk-0cdb4a0e28663cde0937601d26789ba5a6697848.tar.bz2
egawk-0cdb4a0e28663cde0937601d26789ba5a6697848.zip
Merge branch 'gawk-5.1-stable'
Diffstat (limited to 'support/regex_internal.c')
-rw-r--r--support/regex_internal.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/support/regex_internal.c b/support/regex_internal.c
index 3945ee7e..0e6919f3 100644
--- a/support/regex_internal.c
+++ b/support/regex_internal.c
@@ -1396,24 +1396,22 @@ re_dfa_add_node (re_dfa_t *dfa, re_token_t token)
if (__glibc_unlikely (new_nodes == NULL))
return -1;
dfa->nodes = new_nodes;
+ dfa->nodes_alloc = new_nodes_alloc;
new_nexts = re_realloc (dfa->nexts, Idx, new_nodes_alloc);
+ if (new_nexts != NULL)
+ dfa->nexts = new_nexts;
new_indices = re_realloc (dfa->org_indices, Idx, new_nodes_alloc);
+ if (new_indices != NULL)
+ dfa->org_indices = new_indices;
new_edests = re_realloc (dfa->edests, re_node_set, new_nodes_alloc);
+ if (new_edests != NULL)
+ dfa->edests = new_edests;
new_eclosures = re_realloc (dfa->eclosures, re_node_set, new_nodes_alloc);
+ if (new_eclosures != NULL)
+ dfa->eclosures = new_eclosures;
if (__glibc_unlikely (new_nexts == NULL || new_indices == NULL
|| new_edests == NULL || new_eclosures == NULL))
- {
- re_free (new_nexts);
- re_free (new_indices);
- re_free (new_edests);
- re_free (new_eclosures);
- return -1;
- }
- dfa->nexts = new_nexts;
- dfa->org_indices = new_indices;
- dfa->edests = new_edests;
- dfa->eclosures = new_eclosures;
- dfa->nodes_alloc = new_nodes_alloc;
+ return -1;
}
dfa->nodes[dfa->nodes_len] = token;
dfa->nodes[dfa->nodes_len].constraint = 0;