summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-06-22 11:14:31 (GMT)
committerGitHub <noreply@github.com>2024-06-22 11:14:31 (GMT)
commitb1bccab588b978220f16eedf839af70cb8bb76ea (patch)
tree2c7e33e4a805903c988fbbf76033cbfe54645886 /Python
parentf1acb3a5927ef813381d40be6fec068a655ddb7a (diff)
downloadcpython-b1bccab588b978220f16eedf839af70cb8bb76ea.zip
cpython-b1bccab588b978220f16eedf839af70cb8bb76ea.tar.gz
cpython-b1bccab588b978220f16eedf839af70cb8bb76ea.tar.bz2
[3.12] gh-120811: Fix reference leak upon `_PyContext_Exit` failure (GH-120812) (#120844)
gh-120811: Fix reference leak upon `_PyContext_Exit` failure (GH-120812) (cherry picked from commit aed31beca9a54b85a1392631a48da80602210f18) Co-authored-by: Peter <zintensitydev@gmail.com> Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Diffstat (limited to 'Python')
-rw-r--r--Python/context.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Python/context.c b/Python/context.c
index 1ffae98..7bccfad 100644
--- a/Python/context.c
+++ b/Python/context.c
@@ -669,6 +669,7 @@ context_run(PyContext *self, PyObject *const *args,
ts, args[0], args + 1, nargs - 1, kwnames);
if (_PyContext_Exit(ts, (PyObject *)self)) {
+ Py_XDECREF(call_result);
return NULL;
}