summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2015-04-19 19:15:02 (GMT)
committerChristian Heimes <christian@python.org>2015-04-19 19:15:02 (GMT)
commit1a084a882b6d201320aa834bfd14e1b9a445c139 (patch)
tree162aacbf445fe1e61256342d0230b5e2101de6c4 /Python
parentdb46fea8b63582e76a29f9dd23882523a474b600 (diff)
parente0ac2beb4febece5ffdf1b7db7a2f53a8c187ce4 (diff)
downloadcpython-1a084a882b6d201320aa834bfd14e1b9a445c139.zip
cpython-1a084a882b6d201320aa834bfd14e1b9a445c139.tar.gz
cpython-1a084a882b6d201320aa834bfd14e1b9a445c139.tar.bz2
Issue #23998: PyImport_ReInitLock() now checks for lock allocation error
Diffstat (limited to 'Python')
-rw-r--r--Python/import.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Python/import.c b/Python/import.c
index 46c6b53..999da37 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -209,8 +209,12 @@ _PyImport_ReleaseLock(void)
void
_PyImport_ReInitLock(void)
{
- if (import_lock != NULL)
+ if (import_lock != NULL) {
import_lock = PyThread_allocate_lock();
+ if (import_lock == NULL) {
+ Py_FatalError("PyImport_ReInitLock failed to create a new lock");
+ }
+ }
if (import_lock_level > 1) {
/* Forked as a side effect of import */
long me = PyThread_get_thread_ident();