summaryrefslogtreecommitdiffstats
path: root/crypto/ui
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2021-12-28 13:32:57 +0100
committerTomas Mraz <tomas@openssl.org>2022-01-05 10:04:51 +0100
commit52d9a1d0448432182a5fab0753c236b29819a2a5 (patch)
treeb3469f60e004815d4df5d25d6fd95968a982439a /crypto/ui
parentdd05385e36582f34e691b1350dd7daf74df5cc90 (diff)
close_console: Always unlock as the lock is always held
Fixes #17364 Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17395)
Diffstat (limited to 'crypto/ui')
-rw-r--r--crypto/ui/ui_openssl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/ui/ui_openssl.c b/crypto/ui/ui_openssl.c
index 9526c16536..eab29e288d 100644
--- a/crypto/ui/ui_openssl.c
+++ b/crypto/ui/ui_openssl.c
@@ -572,6 +572,8 @@ static int echo_console(UI *ui)
static int close_console(UI *ui)
{
+ int ret = 1;
+
if (tty_in != stdin)
fclose(tty_in);
if (tty_out != stderr)
@@ -584,12 +586,12 @@ static int close_console(UI *ui)
BIO_snprintf(tmp_num, sizeof(tmp_num) - 1, "%%X%08X", status);
UIerr(UI_F_CLOSE_CONSOLE, UI_R_SYSDASSGN_ERROR);
ERR_add_error_data(2, "status=", tmp_num);
- return 0;
+ ret = 0;
}
# endif
CRYPTO_THREAD_unlock(ui->lock);
- return 1;
+ return ret;
}
# if !defined(OPENSSL_SYS_WINCE)