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_openssl.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_openssl.c')
-rw-r--r-- | src/lib/libcrypto/engine/eng_openssl.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libcrypto/engine/eng_openssl.c b/src/lib/libcrypto/engine/eng_openssl.c index 6154aebdee..f8f6c8f58c 100644 --- a/src/lib/libcrypto/engine/eng_openssl.c +++ b/src/lib/libcrypto/engine/eng_openssl.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: eng_openssl.c,v 1.12 2015/12/07 03:30:09 bcook Exp $ */ | 1 | /* $OpenBSD: eng_openssl.c,v 1.13 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 | */ |
@@ -177,7 +177,7 @@ engine_openssl(void) | |||
177 | { | 177 | { |
178 | ENGINE *ret = ENGINE_new(); | 178 | ENGINE *ret = ENGINE_new(); |
179 | 179 | ||
180 | if (!ret) | 180 | if (ret == NULL) |
181 | return NULL; | 181 | return NULL; |
182 | if (!bind_helper(ret)) { | 182 | if (!bind_helper(ret)) { |
183 | ENGINE_free(ret); | 183 | ENGINE_free(ret); |
@@ -191,7 +191,7 @@ ENGINE_load_openssl(void) | |||
191 | { | 191 | { |
192 | ENGINE *toadd = engine_openssl(); | 192 | ENGINE *toadd = engine_openssl(); |
193 | 193 | ||
194 | if (!toadd) | 194 | if (toadd == NULL) |
195 | return; | 195 | return; |
196 | (void) ENGINE_add(toadd); | 196 | (void) ENGINE_add(toadd); |
197 | /* If the "add" worked, it gets a structural reference. So either way, | 197 | /* If the "add" worked, it gets a structural reference. So either way, |