diff options
Diffstat (limited to 'crypto/ui/ui_lib.c')
-rw-r--r-- | crypto/ui/ui_lib.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/ui/ui_lib.c b/crypto/ui/ui_lib.c index 98519877f4..533dc076ae 100644 --- a/crypto/ui/ui_lib.c +++ b/crypto/ui/ui_lib.c @@ -374,9 +374,10 @@ char *UI_construct_prompt(UI *ui, const char *object_desc, len += sizeof(prompt2) - 1 + strlen(object_name); len += sizeof(prompt3) - 1; - prompt = OPENSSL_malloc(len + 1); - if (prompt == NULL) + if ((prompt = OPENSSL_malloc(len + 1)) == NULL) { + UIerr(UI_F_UI_CONSTRUCT_PROMPT, ERR_R_MALLOC_FAILURE); return NULL; + } OPENSSL_strlcpy(prompt, prompt1, len + 1); OPENSSL_strlcat(prompt, object_desc, len + 1); if (object_name != NULL) { |