diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2022-03-25 14:00:55 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2022-03-25 14:00:55 +0300 |
commit | 6739849e21c5bfd849b0c4029c2950902e7656af (patch) | |
tree | 69422f7ef3e6c047886dbeac15cad753e6a89248 /support/regex_internal.c | |
parent | c07a390e647b74a40f1726e6fe3580bc370f178b (diff) | |
download | egawk-6739849e21c5bfd849b0c4029c2950902e7656af.tar.gz egawk-6739849e21c5bfd849b0c4029c2950902e7656af.tar.bz2 egawk-6739849e21c5bfd849b0c4029c2950902e7656af.zip |
Sync support files from GNULIB.
Diffstat (limited to 'support/regex_internal.c')
-rw-r--r-- | support/regex_internal.c | 22 |
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; |