From ad9b9dbc1057d5456cf1d89ab42be3f945fd784f Mon Sep 17 00:00:00 2001 From: Peter <49501366+ZeroIntensity@users.noreply.github.com> Date: Thu, 20 Jun 2024 16:51:49 -0400 Subject: [PATCH 1/4] Fix reference leak upon `_PyContext_Exit` failure --- Python/context.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Python/context.c b/Python/context.c index 42000b13038834..a3830be17908fe 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; } From 382940e9a28cc20bdf921ae1fcc7be5f3f9f8ace Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Fri, 21 Jun 2024 14:32:57 +0000 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../next/Library/2024-06-21-14-32-56.gh-issue-120811.eBmVTV.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Library/2024-06-21-14-32-56.gh-issue-120811.eBmVTV.rst diff --git a/Misc/NEWS.d/next/Library/2024-06-21-14-32-56.gh-issue-120811.eBmVTV.rst b/Misc/NEWS.d/next/Library/2024-06-21-14-32-56.gh-issue-120811.eBmVTV.rst new file mode 100644 index 00000000000000..c333fffeca5ccc --- /dev/null +++ b/Misc/NEWS.d/next/Library/2024-06-21-14-32-56.gh-issue-120811.eBmVTV.rst @@ -0,0 +1 @@ +Fix memory leak in `contextvars.Context.run()` From 3166cf610eae93ba49d8e7c0ddbf95b6b58b0b4f Mon Sep 17 00:00:00 2001 From: Peter Date: Fri, 21 Jun 2024 10:39:10 -0400 Subject: [PATCH 3/4] Update 2024-06-21-14-32-56.gh-issue-120811.eBmVTV.rst --- .../next/Library/2024-06-21-14-32-56.gh-issue-120811.eBmVTV.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Library/2024-06-21-14-32-56.gh-issue-120811.eBmVTV.rst b/Misc/NEWS.d/next/Library/2024-06-21-14-32-56.gh-issue-120811.eBmVTV.rst index c333fffeca5ccc..b8956a89cd16a0 100644 --- a/Misc/NEWS.d/next/Library/2024-06-21-14-32-56.gh-issue-120811.eBmVTV.rst +++ b/Misc/NEWS.d/next/Library/2024-06-21-14-32-56.gh-issue-120811.eBmVTV.rst @@ -1 +1 @@ -Fix memory leak in `contextvars.Context.run()` +Fix memory leak in ``contextvars.Context.run()`` From 70a2e7e399d0eed6f0805a31e2e003e50ec073c0 Mon Sep 17 00:00:00 2001 From: Kumar Aditya Date: Fri, 21 Jun 2024 22:34:08 +0530 Subject: [PATCH 4/4] Update Misc/NEWS.d/next/Library/2024-06-21-14-32-56.gh-issue-120811.eBmVTV.rst --- .../next/Library/2024-06-21-14-32-56.gh-issue-120811.eBmVTV.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Library/2024-06-21-14-32-56.gh-issue-120811.eBmVTV.rst b/Misc/NEWS.d/next/Library/2024-06-21-14-32-56.gh-issue-120811.eBmVTV.rst index b8956a89cd16a0..62cd7b5620474a 100644 --- a/Misc/NEWS.d/next/Library/2024-06-21-14-32-56.gh-issue-120811.eBmVTV.rst +++ b/Misc/NEWS.d/next/Library/2024-06-21-14-32-56.gh-issue-120811.eBmVTV.rst @@ -1 +1 @@ -Fix memory leak in ``contextvars.Context.run()`` +Fix possible memory leak in :meth:`contextvars.Context.run`.