From af021f136e277a4eec00a1a31d159a17f3e3cd85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Fri, 25 Jan 2019 21:47:37 +0100 Subject: [PATCH] Do not fail on NULL passed to OpenSSL_free Some plugins might call it after deconstruction. Do not crash if there is no reason for it. (cherry picked from commit a26673a08863cdcb48ea91dd9c5e0ef4386ce931) --- CHANGES | 4 ++++ lib/dns/openssl_link.c | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 7cadfc0164..c4a6a79fa5 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +5146. [bug] Removed an unnecessary assert that could be + triggered from PKCS#11 modules during + deconstruction. [GL #841] + 5143. [bug] dnssec-keymgr and dnssec-coverage failed to find key files for zone names ending in ".". [GL #560] diff --git a/lib/dns/openssl_link.c b/lib/dns/openssl_link.c index b757e2258b..d65ce26ee7 100644 --- a/lib/dns/openssl_link.c +++ b/lib/dns/openssl_link.c @@ -160,9 +160,11 @@ mem_alloc(size_t size FLARG) { static void mem_free(void *ptr FLARG) { - INSIST(dst__memory_pool != NULL); - if (ptr != NULL) + if (ptr != NULL) { + INSIST(dst__memory_pool != NULL); + isc__mem_free(dst__memory_pool, ptr FLARG_PASS); + } } static void *