]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-67877: Fix memory leaks in terminated RE matching (GH-126840) (GH-126960)
authorSerhiy Storchaka <storchaka@gmail.com>
Mon, 18 Nov 2024 11:26:45 +0000 (13:26 +0200)
committerGitHub <noreply@github.com>
Mon, 18 Nov 2024 11:26:45 +0000 (11:26 +0000)
commit885386b4a258caa6bdca6b7cc6db2f2d2dd2987d
tree18d3d33817afb89c18abdfa7e5e890020406f12a
parent2b2ad244c076588da401ffa68fc2cad346da6667
[3.13] gh-67877: Fix memory leaks in terminated RE matching (GH-126840) (GH-126960)

If SRE(match) function terminates abruptly, either because of a signal
or because memory allocation fails, allocated SRE_REPEAT blocks might
be never released.

Co-authored-by: <wjssz@users.noreply.github.com>
(cherry picked from commit 7538e7f5696408fa0aa02fce8a413a7dfac76a04)
Lib/test/test_re.py
Misc/NEWS.d/next/Library/2024-11-14-22-25-49.gh-issue-67877.G9hw0w.rst [new file with mode: 0644]
Modules/_sre/clinic/sre.c.h
Modules/_sre/sre.c
Modules/_sre/sre.h
Modules/_sre/sre_lib.h