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, 6 insertions, 1 deletions
diff --git a/crypto/ui/ui_lib.c b/crypto/ui/ui_lib.c
index a5d8aac064..3d0df5140d 100644
--- a/crypto/ui/ui_lib.c
+++ b/crypto/ui/ui_lib.c
@@ -536,8 +536,13 @@ UI_METHOD *UI_create_method(char *name)
{
UI_METHOD *ui_method = OPENSSL_zalloc(sizeof(*ui_method));
- if (ui_method != NULL)
+ if (ui_method != NULL) {
ui_method->name = OPENSSL_strdup(name);
+ if (ui_method->name == NULL) {
+ OPENSSL_free(ui_method);
+ return NULL;
+ }
+ }
return ui_method;
}