summaryrefslogtreecommitdiffstats
path: root/crypto/ui/ui_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/ui/ui_lib.c')
-rw-r--r--crypto/ui/ui_lib.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/crypto/ui/ui_lib.c b/crypto/ui/ui_lib.c
index f4e01bcf38..4469a436c2 100644
--- a/crypto/ui/ui_lib.c
+++ b/crypto/ui/ui_lib.c
@@ -37,9 +37,10 @@ UI *UI_new_method(const UI_METHOD *method)
}
if (method == NULL)
- ret->meth = UI_get_default_method();
- else
- ret->meth = method;
+ method = UI_get_default_method();
+ if (method == NULL)
+ method = UI_null();
+ ret->meth = method;
if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_UI, ret, &ret->ex_data)) {
OPENSSL_free(ret);