]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-1635741: Fix ref leak in _PyWarnings_Init() error path (GH-23151)
authorVictor Stinner <vstinner@python.org>
Wed, 4 Nov 2020 16:33:06 +0000 (17:33 +0100)
committerGitHub <noreply@github.com>
Wed, 4 Nov 2020 16:33:06 +0000 (17:33 +0100)
commit58ca33b4674f39189b03c9a39fa7b676b43b3d08
treefa25afd9e677de7e2c113816ae199551240a4158
parent18ce7f1d0a3d65f34f25c5964da588743a1bfe3c
bpo-1635741: Fix ref leak in _PyWarnings_Init() error path (GH-23151)

Replace PyModule_AddObject() with PyModule_AddObjectRef() in the
_warnings module to fix a reference leak on error.

Use also PyModule_AddObjectRef() in importdl.c.
Python/_warnings.c
Python/importdl.c