diff options
author | jsing <> | 2022-12-23 02:26:16 +0000 |
---|---|---|
committer | jsing <> | 2022-12-23 02:26:16 +0000 |
commit | 9902ad884661178b3f5d08fc01069eb4c1b2ba95 (patch) | |
tree | c1502abf0724af38378a71125d9bb57784e95670 /src | |
parent | 810f7185c0506d132dd79c64e678248412974254 (diff) | |
download | openbsd-9902ad884661178b3f5d08fc01069eb4c1b2ba95.tar.gz openbsd-9902ad884661178b3f5d08fc01069eb4c1b2ba95.tar.bz2 openbsd-9902ad884661178b3f5d08fc01069eb4c1b2ba95.zip |
Make UI_destroy_method() NULL safe.
ok tb@
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/ui/ui_lib.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/lib/libcrypto/ui/ui_lib.c b/src/lib/libcrypto/ui/ui_lib.c index 69428f9a2a..e36c270a87 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.47 2022/12/23 02:22:58 jsing Exp $ */ | 1 | /* $OpenBSD: ui_lib.c,v 1.48 2022/12/23 02:26:16 jsing 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 | */ |
@@ -575,11 +575,13 @@ UI_create_method(const char *name) | |||
575 | LCRYPTO_ALIAS(UI_create_method) | 575 | LCRYPTO_ALIAS(UI_create_method) |
576 | 576 | ||
577 | void | 577 | void |
578 | UI_destroy_method(UI_METHOD *ui_method) | 578 | UI_destroy_method(UI_METHOD *method) |
579 | { | 579 | { |
580 | free(ui_method->name); | 580 | if (method == NULL) |
581 | ui_method->name = NULL; | 581 | return; |
582 | free(ui_method); | 582 | |
583 | free(method->name); | ||
584 | free(method); | ||
583 | } | 585 | } |
584 | LCRYPTO_ALIAS(UI_destroy_method) | 586 | LCRYPTO_ALIAS(UI_destroy_method) |
585 | 587 | ||