From: Francis Dupont Date: Thu, 8 Dec 2016 17:36:38 +0000 (+0100) Subject: [4633] Addressed some comments X-Git-Tag: trac3590_base~4^2~1^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9cef9973a4988093827e6e32af6c9572dd11bbc8;p=thirdparty%2Fkea.git [4633] Addressed some comments --- diff --git a/src/lib/cryptolink/openssl_compat.h b/src/lib/cryptolink/openssl_compat.h index ef354eef3b..886d951df1 100644 --- a/src/lib/cryptolink/openssl_compat.h +++ b/src/lib/cryptolink/openssl_compat.h @@ -8,6 +8,9 @@ #if OPENSSL_VERSION_NUMBER < 0x10100000L +// This file is included by hash and hmac codes so KEA_H* macros +// avoid to define unused inlines. + #ifdef KEA_HASH // EVP_MD_CTX_new() is EVP_MD_CTX_create() in OpenSSL < 1.1 @@ -39,8 +42,10 @@ inline HMAC_CTX* HMAC_CTX_new() { // HMAC_CTX_free() implementation for OpenSSL < 1.1 inline void HMAC_CTX_free(HMAC_CTX* ctx) { - HMAC_CTX_cleanup(ctx); - OPENSSL_free(ctx); + if (ctx != 0) { + HMAC_CTX_cleanup(ctx); + OPENSSL_free(ctx); + } } #endif