diff options
author | Ma Lin <animalize@users.noreply.github.com> | 2022-04-03 16:16:20 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-03 16:16:20 (GMT) |
commit | 6e3eee5c11b539e9aab39cff783acf57838c355a (patch) | |
tree | 29ee6720d249adfe5864ab9f09d7cb54d9f35238 /Modules/sre.h | |
parent | b82cdd1dac9a9be52051abd90a1ce69236ac41f4 (diff) | |
download | cpython-6e3eee5c11b539e9aab39cff783acf57838c355a.zip cpython-6e3eee5c11b539e9aab39cff783acf57838c355a.tar.gz cpython-6e3eee5c11b539e9aab39cff783acf57838c355a.tar.bz2 |
bpo-23689: re module, fix memory leak when a match is terminated by a signal or memory allocation failure (GH-32283)
Diffstat (limited to 'Modules/sre.h')
-rw-r--r-- | Modules/sre.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/sre.h b/Modules/sre.h index 785adbd..e2c5277 100644 --- a/Modules/sre.h +++ b/Modules/sre.h @@ -29,6 +29,8 @@ typedef struct { Py_ssize_t groups; /* must be first! */ PyObject* groupindex; /* dict */ PyObject* indexgroup; /* tuple */ + /* the number of REPEATs */ + Py_ssize_t repeat_count; /* compatibility */ PyObject* pattern; /* pattern source (or None) */ int flags; /* flags used when compiling pattern source */ @@ -83,6 +85,8 @@ typedef struct { size_t data_stack_base; /* current repeat context */ SRE_REPEAT *repeat; + /* repeat contexts array */ + SRE_REPEAT *repeats_array; } SRE_STATE; typedef struct { |