diff options
author | Christian Heimes <christian@python.org> | 2015-04-19 19:08:28 (GMT) |
---|---|---|
committer | Christian Heimes <christian@python.org> | 2015-04-19 19:08:28 (GMT) |
commit | 3ce7873fddef05ecd6c5da2d5bd40206fee3805c (patch) | |
tree | 4e283cf18b23cef0ab658b6535659284fa00f342 /Python | |
parent | 1b4aa45441bccb350887add4cbef4fd73680eef0 (diff) | |
download | cpython-3ce7873fddef05ecd6c5da2d5bd40206fee3805c.zip cpython-3ce7873fddef05ecd6c5da2d5bd40206fee3805c.tar.gz cpython-3ce7873fddef05ecd6c5da2d5bd40206fee3805c.tar.bz2 |
Issue #23998: PyImport_ReInitLock() now checks for lock allocation error
Diffstat (limited to 'Python')
-rw-r--r-- | Python/import.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Python/import.c b/Python/import.c index 92363b3..e47ce63 100644 --- a/Python/import.c +++ b/Python/import.c @@ -337,8 +337,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"); + } + } import_lock_thread = -1; import_lock_level = 0; } |