summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2020-03-08 16:07:58 (GMT)
committerGitHub <noreply@github.com>2020-03-08 16:07:58 (GMT)
commit89fabe51af27a16ae71733334ad94921e3980e28 (patch)
treeb5e70bdbe340708cf40121f563882d8afdb702b6 /Python
parentcca0b31fb8ed7d25ede68f314d4a85bb07d6ca6f (diff)
downloadcpython-89fabe51af27a16ae71733334ad94921e3980e28.zip
cpython-89fabe51af27a16ae71733334ad94921e3980e28.tar.gz
cpython-89fabe51af27a16ae71733334ad94921e3980e28.tar.bz2
[3.7] bpo-39831: Fix a reference leak in PyErr_WarnEx(). (GH-18750). (GH-18765)
(cherry picked from commit 2d2f85517f8216146a2f888d1ad4d765b3be2339)
Diffstat (limited to 'Python')
-rw-r--r--Python/_warnings.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Python/_warnings.c b/Python/_warnings.c
index 1a2035e..e86a582 100644
--- a/Python/_warnings.c
+++ b/Python/_warnings.c
@@ -710,7 +710,7 @@ setup_context(Py_ssize_t stack_level, PyObject **filename, int *lineno,
*registry = PyDict_New();
if (*registry == NULL)
- goto handle_error;
+ return 0;
rc = PyDict_SetItemString(globals, "__warningregistry__", *registry);
if (rc < 0)
@@ -802,7 +802,6 @@ setup_context(Py_ssize_t stack_level, PyObject **filename, int *lineno,
dangling reference. */
Py_XDECREF(*registry);
Py_XDECREF(*module);
- Py_XDECREF(*filename);
return 0;
}