/* Internal functions to open, handle and close a channel to the console. */
static int open_console(UI *ui)
{
- CRYPTO_THREAD_write_lock(ui->lock);
+ if (!CRYPTO_THREAD_write_lock(ui->lock))
+ return 0;
is_a_tty = 1;
# if defined(OPENSSL_SYS_VXWORKS)