diff options
author | tb <> | 2018-04-14 07:18:37 +0000 |
---|---|---|
committer | tb <> | 2018-04-14 07:18:37 +0000 |
commit | 1e9445503c3ea65f8c138ab5dc555db0f1db91a7 (patch) | |
tree | 27f20ba7d1bd380c7995e6d349ae1b5f8b90cc6d /src/lib/libcrypto/engine/eng_lib.c | |
parent | a32b35170819e9b07e0183d19aee21b9a246943b (diff) | |
download | openbsd-1e9445503c3ea65f8c138ab5dc555db0f1db91a7.tar.gz openbsd-1e9445503c3ea65f8c138ab5dc555db0f1db91a7.tar.bz2 openbsd-1e9445503c3ea65f8c138ab5dc555db0f1db91a7.zip |
Make ENGINE_free() succeed on NULL. Matches OpenSSL's behavior and
simplifies the caller side.
tested by & ok inoguchi; discussed with schwarze
Diffstat (limited to 'src/lib/libcrypto/engine/eng_lib.c')
-rw-r--r-- | src/lib/libcrypto/engine/eng_lib.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/lib/libcrypto/engine/eng_lib.c b/src/lib/libcrypto/engine/eng_lib.c index 11ad771109..1aedcb18c6 100644 --- a/src/lib/libcrypto/engine/eng_lib.c +++ b/src/lib/libcrypto/engine/eng_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: eng_lib.c,v 1.13 2018/03/17 16:20:01 beck Exp $ */ | 1 | /* $OpenBSD: eng_lib.c,v 1.14 2018/04/14 07:18:37 tb Exp $ */ |
2 | /* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL | 2 | /* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL |
3 | * project 2000. | 3 | * project 2000. |
4 | */ | 4 | */ |
@@ -115,10 +115,8 @@ engine_free_util(ENGINE *e, int locked) | |||
115 | { | 115 | { |
116 | int i; | 116 | int i; |
117 | 117 | ||
118 | if (e == NULL) { | 118 | if (e == NULL) |
119 | ENGINEerror(ERR_R_PASSED_NULL_PARAMETER); | 119 | return 1; |
120 | return 0; | ||
121 | } | ||
122 | if (locked) | 120 | if (locked) |
123 | i = CRYPTO_add(&e->struct_ref, -1, CRYPTO_LOCK_ENGINE); | 121 | i = CRYPTO_add(&e->struct_ref, -1, CRYPTO_LOCK_ENGINE); |
124 | else | 122 | else |