diff options
author | dartraiden <wowemuh@gmail.com> | 2021-06-30 21:21:41 +0300 |
---|---|---|
committer | dartraiden <wowemuh@gmail.com> | 2021-06-30 21:22:59 +0300 |
commit | 9f55a6a701295f0d78bc9704d309eab389b695ea (patch) | |
tree | 3dc8550094a21f8b1a50a4a397f1bb8a1501383d /libs/Pcre16/src/pcre_compile.c | |
parent | f011f3aadeead36afe5b923a42cea5a1c883bf7d (diff) |
PCRE: update to 8.45
Diffstat (limited to 'libs/Pcre16/src/pcre_compile.c')
-rw-r--r-- | libs/Pcre16/src/pcre_compile.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libs/Pcre16/src/pcre_compile.c b/libs/Pcre16/src/pcre_compile.c index 3be0fbfb18..8b80abe039 100644 --- a/libs/Pcre16/src/pcre_compile.c +++ b/libs/Pcre16/src/pcre_compile.c @@ -6,7 +6,7 @@ and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel - Copyright (c) 1997-2020 University of Cambridge + Copyright (c) 1997-2021 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without @@ -9099,6 +9099,8 @@ pcre_uchar cworkspace[COMPILE_WORK_SIZE]; similar way to cworkspace, it can be expanded using malloc() if necessary. */ named_group named_groups[NAMED_GROUP_LIST_SIZE]; +cd->named_groups = named_groups; +cd->named_group_list_size = NAMED_GROUP_LIST_SIZE; /* Set this early so that early errors get offset 0. */ @@ -9372,8 +9374,6 @@ cd->hwm = cworkspace; cd->iscondassert = FALSE; cd->start_workspace = cworkspace; cd->workspace_size = COMPILE_WORK_SIZE; -cd->named_groups = named_groups; -cd->named_group_list_size = NAMED_GROUP_LIST_SIZE; cd->start_pattern = (const pcre_uchar *)pattern; cd->end_pattern = (const pcre_uchar *)(pattern + STRLEN_UC((const pcre_uchar *)pattern)); cd->req_varyopt = 0; @@ -9484,6 +9484,7 @@ if (cd->names_found > 0) add_name(cd, ng->name, ng->length, ng->number); if (cd->named_group_list_size > NAMED_GROUP_LIST_SIZE) (PUBL(free))((void *)cd->named_groups); + cd->named_group_list_size = 0; /* So we don't free it twice */ } /* Set up a starting, non-extracting bracket, then compile the expression. On @@ -9634,6 +9635,8 @@ if (errorcode != 0) { (PUBL(free))(re); PCRE_EARLY_ERROR_RETURN: + if (cd->named_group_list_size > NAMED_GROUP_LIST_SIZE) + (PUBL(free))((void *)cd->named_groups); *erroroffset = (int)(ptr - (const pcre_uchar *)pattern); PCRE_EARLY_ERROR_RETURN2: *errorptr = find_error_text(errorcode); |