summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@python.org>2022-11-21 18:13:33 (GMT)
committerGitHub <noreply@github.com>2022-11-21 18:13:33 (GMT)
commit7b98207aa46bd637d07a7c4a84e998726b74acde (patch)
tree957176aa8a6809f2bcb479df87feca0b55d0c86b /Python/sysmodule.c
parentc09dba57cfbbf74273ce44b1f48f71b46806605c (diff)
downloadcpython-7b98207aa46bd637d07a7c4a84e998726b74acde.zip
cpython-7b98207aa46bd637d07a7c4a84e998726b74acde.tar.gz
cpython-7b98207aa46bd637d07a7c4a84e998726b74acde.tar.bz2
[3.9] gh-87604: Avoid publishing list of active per-interpreter audit hooks via the gc module (GH-99373) (GH-99493)
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 8efa850..a8f2f02 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -440,6 +440,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) {