summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2015-04-19 19:12:14 (GMT)
committerChristian Heimes <christian@python.org>2015-04-19 19:12:14 (GMT)
commite0ac2beb4febece5ffdf1b7db7a2f53a8c187ce4 (patch)
tree903bd402a3fe4e8c59af65209eb3396dab5fb28d /Python
parentd6e53dab8677fae3f6d00053b0102f8031751587 (diff)
parent418fd74f87756c4312db496db92118bba2c4484a (diff)
downloadcpython-e0ac2beb4febece5ffdf1b7db7a2f53a8c187ce4.zip
cpython-e0ac2beb4febece5ffdf1b7db7a2f53a8c187ce4.tar.gz
cpython-e0ac2beb4febece5ffdf1b7db7a2f53a8c187ce4.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 7ee7ed9..34f4fd5 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -207,8 +207,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();