From 1e9445503c3ea65f8c138ab5dc555db0f1db91a7 Mon Sep 17 00:00:00 2001 From: tb <> Date: Sat, 14 Apr 2018 07:18:37 +0000 Subject: Make ENGINE_free() succeed on NULL. Matches OpenSSL's behavior and simplifies the caller side. tested by & ok inoguchi; discussed with schwarze --- src/lib/libcrypto/engine/eng_openssl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lib/libcrypto/engine/eng_openssl.c') 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 @@ -/* $OpenBSD: eng_openssl.c,v 1.12 2015/12/07 03:30:09 bcook Exp $ */ +/* $OpenBSD: eng_openssl.c,v 1.13 2018/04/14 07:18:37 tb Exp $ */ /* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL * project 2000. */ @@ -177,7 +177,7 @@ engine_openssl(void) { ENGINE *ret = ENGINE_new(); - if (!ret) + if (ret == NULL) return NULL; if (!bind_helper(ret)) { ENGINE_free(ret); @@ -191,7 +191,7 @@ ENGINE_load_openssl(void) { ENGINE *toadd = engine_openssl(); - if (!toadd) + if (toadd == NULL) return; (void) ENGINE_add(toadd); /* If the "add" worked, it gets a structural reference. So either way, -- cgit v1.2.3-55-g6feb