summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-11-21 21:06:01 (GMT)
committerGitHub <noreply@github.com>2022-11-21 21:06:01 (GMT)
commitb50b6f95a1afacf76cc6ec3da4229cdeb33a7cf6 (patch)
tree1ef71b4da605292c5a4a8d0d386b22608b73cc4f /Python/sysmodule.c
parent82ca2839c9ec6bf9a9400e791a52411824df67f3 (diff)
downloadcpython-b50b6f95a1afacf76cc6ec3da4229cdeb33a7cf6.zip
cpython-b50b6f95a1afacf76cc6ec3da4229cdeb33a7cf6.tar.gz
cpython-b50b6f95a1afacf76cc6ec3da4229cdeb33a7cf6.tar.bz2
[3.8] gh-87604: Avoid publishing list of active per-interpreter audit hooks via the gc module (GH-99373) (GH-99661)
(cherry picked from commit 7b98207aa46bd637d07a7c4a84e998726b74acde) Co-authored-by: Steve Dower <steve.dower@python.org>
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index ffda714..eb3245a 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -356,6 +356,8 @@ sys_addaudithook_impl(PyObject *module, PyObject *hook)
if (is->audit_hooks == NULL) {
return NULL;
}
+ /* Avoid having our list of hooks show up in the GC module */
+ PyObject_GC_UnTrack(is->audit_hooks);
}
if (PyList_Append(is->audit_hooks, hook) < 0) {