summaryrefslogtreecommitdiffstats
path: root/crypto/ui/ui_openssl.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/ui/ui_openssl.c')
-rw-r--r--crypto/ui/ui_openssl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/ui/ui_openssl.c b/crypto/ui/ui_openssl.c
index 0a38658c72..42524d42a2 100644
--- a/crypto/ui/ui_openssl.c
+++ b/crypto/ui/ui_openssl.c
@@ -372,7 +372,8 @@ static int read_string_inner(UI *ui, UI_STRING *uis, int echo, int strip_nl)
/* 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)