From 8b60c9a777523278ddbc7a43f410248840567f0d Mon Sep 17 00:00:00 2001 From: tb <> Date: Thu, 24 Sep 2020 19:24:45 +0000 Subject: Push ERR_R_MALLOC_FAILURE onto the error stack If sk_UI_STRING_new_null() fails, this must be due to a memory error, so signal this to the user. ok jsing --- src/lib/libcrypto/ui/ui_lib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libcrypto/ui/ui_lib.c b/src/lib/libcrypto/ui/ui_lib.c index 27c7e5126f..32a56e581b 100644 --- a/src/lib/libcrypto/ui/ui_lib.c +++ b/src/lib/libcrypto/ui/ui_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ui_lib.c,v 1.35 2020/09/24 19:22:18 tb Exp $ */ +/* $OpenBSD: ui_lib.c,v 1.36 2020/09/24 19:24:45 tb Exp $ */ /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL * project 2001. */ @@ -130,8 +130,8 @@ static int allocate_string_stack(UI *ui) { if (ui->strings == NULL) { - ui->strings = sk_UI_STRING_new_null(); - if (ui->strings == NULL) { + if ((ui->strings = sk_UI_STRING_new_null()) == NULL) { + UIerror(ERR_R_MALLOC_FAILURE); return -1; } } -- cgit v1.2.3-55-g6feb