]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-36333: Fix leak _PyRuntimeState_Fini (GH-12400)
authorStéphane Wirtel <stephane@wirtel.be>
Tue, 19 Mar 2019 10:51:32 +0000 (11:51 +0100)
committerVictor Stinner <vstinner@redhat.com>
Tue, 19 Mar 2019 10:51:32 +0000 (11:51 +0100)
Misc/NEWS.d/next/Core and Builtins/2019-03-18-10-56-53.bpo-36333.4dqemZ.rst [new file with mode: 0644]
Python/pystate.c

diff --git a/Misc/NEWS.d/next/Core and Builtins/2019-03-18-10-56-53.bpo-36333.4dqemZ.rst b/Misc/NEWS.d/next/Core and Builtins/2019-03-18-10-56-53.bpo-36333.4dqemZ.rst
new file mode 100644 (file)
index 0000000..e5af44f
--- /dev/null
@@ -0,0 +1 @@
+Fix leak in _PyRuntimeState_Fini. Contributed by Stéphane Wirtel.
index 6a2dc102ecfebc6cd759855f4e856f58084c2187..36566b767155b318408798080e12dd4882317872 100644 (file)
@@ -92,6 +92,11 @@ _PyRuntimeState_Fini(_PyRuntimeState *runtime)
         runtime->interpreters.mutex = NULL;
     }
 
+    if (runtime->xidregistry.mutex != NULL) {
+        PyThread_free_lock(runtime->xidregistry.mutex);
+        runtime->xidregistry.mutex = NULL;
+    }
+
     PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc);
 }