summaryrefslogtreecommitdiffstats
path: root/lib/libcrypto/ui/ui_lib.c
diff options
context:
space:
mode:
authortb <tb@openbsd.org>2020-09-24 19:24:45 +0000
committertb <tb@openbsd.org>2020-09-24 19:24:45 +0000
commitc95ba6a282693e4bb7785bb3281e553412a77ede (patch)
tree31303836074642bbcd991e66bd2488783df6b110 /lib/libcrypto/ui/ui_lib.c
parentMake free_strings() NULL safe (diff)
downloadwireguard-openbsd-c95ba6a282693e4bb7785bb3281e553412a77ede.tar.xz
wireguard-openbsd-c95ba6a282693e4bb7785bb3281e553412a77ede.zip
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
Diffstat (limited to 'lib/libcrypto/ui/ui_lib.c')
-rw-r--r--lib/libcrypto/ui/ui_lib.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libcrypto/ui/ui_lib.c b/lib/libcrypto/ui/ui_lib.c
index 27c7e5126fc..32a56e581b3 100644
--- a/lib/libcrypto/ui/ui_lib.c
+++ b/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;
}
}