summaryrefslogtreecommitdiffstats
path: root/lib/libcrypto/ui/ui_lib.c
diff options
context:
space:
mode:
authortb <tb@openbsd.org>2020-09-24 19:22:18 +0000
committertb <tb@openbsd.org>2020-09-24 19:22:18 +0000
commit8804eef0fd767ae65f2a945ed02d9b18e22f84ea (patch)
treebb3020ee5f2624b3f83ccdc6a21795b26a158736 /lib/libcrypto/ui/ui_lib.c
parentKNF and grammar tweaks for comments; wrap a few overlong prototypes. (diff)
downloadwireguard-openbsd-8804eef0fd767ae65f2a945ed02d9b18e22f84ea.tar.xz
wireguard-openbsd-8804eef0fd767ae65f2a945ed02d9b18e22f84ea.zip
Make free_strings() NULL safe
ok jsing
Diffstat (limited to 'lib/libcrypto/ui/ui_lib.c')
-rw-r--r--lib/libcrypto/ui/ui_lib.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libcrypto/ui/ui_lib.c b/lib/libcrypto/ui/ui_lib.c
index 06b29b8ceea..27c7e5126fc 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.34 2018/06/02 04:45:21 tb Exp $ */
+/* $OpenBSD: ui_lib.c,v 1.35 2020/09/24 19:22:18 tb Exp $ */
/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL
* project 2001.
*/
@@ -99,6 +99,8 @@ UI_new_method(const UI_METHOD *method)
static void
free_string(UI_STRING *uis)
{
+ if (uis == NULL)
+ return;
if (uis->flags & OUT_STRING_FREEABLE) {
free((char *) uis->out_string);
switch (uis->type) {