summaryrefslogtreecommitdiffstats
path: root/Modules/sre.h
diff options
context:
space:
mode:
authorMa Lin <animalize@users.noreply.github.com>2022-04-03 16:16:20 (GMT)
committerGitHub <noreply@github.com>2022-04-03 16:16:20 (GMT)
commit6e3eee5c11b539e9aab39cff783acf57838c355a (patch)
tree29ee6720d249adfe5864ab9f09d7cb54d9f35238 /Modules/sre.h
parentb82cdd1dac9a9be52051abd90a1ce69236ac41f4 (diff)
downloadcpython-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.h4
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 {