summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ui/ui_lib.c
diff options
context:
space:
mode:
authortb <>2020-09-24 19:22:18 +0000
committertb <>2020-09-24 19:22:18 +0000
commit52f9aecae4f1ab60ff1ec122577f0553c71ff6d8 (patch)
tree1cdaa084f03d4369f73b02b62424f42f45c80ccb /src/lib/libcrypto/ui/ui_lib.c
parent4809a5c52fe0b07db5e0aa03781e19959f612e98 (diff)
downloadopenbsd-52f9aecae4f1ab60ff1ec122577f0553c71ff6d8.tar.gz
openbsd-52f9aecae4f1ab60ff1ec122577f0553c71ff6d8.tar.bz2
openbsd-52f9aecae4f1ab60ff1ec122577f0553c71ff6d8.zip
Make free_strings() NULL safe
ok jsing
Diffstat (limited to 'src/lib/libcrypto/ui/ui_lib.c')
-rw-r--r--src/lib/libcrypto/ui/ui_lib.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/libcrypto/ui/ui_lib.c b/src/lib/libcrypto/ui/ui_lib.c
index 06b29b8cee..27c7e5126f 100644
--- a/src/lib/libcrypto/ui/ui_lib.c
+++ b/src/lib/libcrypto/ui/ui_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ui_lib.c,v 1.34 2018/06/02 04:45:21 tb Exp $ */ 1/* $OpenBSD: ui_lib.c,v 1.35 2020/09/24 19:22:18 tb Exp $ */
2/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL 2/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL
3 * project 2001. 3 * project 2001.
4 */ 4 */
@@ -99,6 +99,8 @@ UI_new_method(const UI_METHOD *method)
99static void 99static void
100free_string(UI_STRING *uis) 100free_string(UI_STRING *uis)
101{ 101{
102 if (uis == NULL)
103 return;
102 if (uis->flags & OUT_STRING_FREEABLE) { 104 if (uis->flags & OUT_STRING_FREEABLE) {
103 free((char *) uis->out_string); 105 free((char *) uis->out_string);
104 switch (uis->type) { 106 switch (uis->type) {