summaryrefslogtreecommitdiffstats
path: root/Python/context.c
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-06-22 11:14:46 (GMT)
committerGitHub <noreply@github.com>2024-06-22 11:14:46 (GMT)
commita860b1d60b8e3d09c58daf6996a38606f407a009 (patch)
tree5902a2d6795a1c45c08e6258cce856047a5299a5 /Python/context.c
parent4fabbf97735ea6d91b32011fb7413d3909b082a0 (diff)
downloadcpython-a860b1d60b8e3d09c58daf6996a38606f407a009.zip
cpython-a860b1d60b8e3d09c58daf6996a38606f407a009.tar.gz
cpython-a860b1d60b8e3d09c58daf6996a38606f407a009.tar.bz2
[3.13] gh-120811: Fix reference leak upon `_PyContext_Exit` failure (GH-120812) (#120843)
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/context.c')
-rw-r--r--Python/context.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Python/context.c b/Python/context.c
index 3937819..63318d1 100644
--- a/Python/context.c
+++ b/Python/context.c
@@ -661,6 +661,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;
}