From 9e2288208de3d3eabac89ee5158f4b94e8ade00f Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 20 Jul 2023 13:10:29 +1000 Subject: [PATCH] Take ownership of pointer before freeing --- lib/isc/tls.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/isc/tls.c b/lib/isc/tls.c index 314de8b6a6..e6996f43a6 100644 --- a/lib/isc/tls.c +++ b/lib/isc/tls.c @@ -844,10 +844,12 @@ isc_tls_create(isc_tlsctx_t *ctx) { void isc_tls_free(isc_tls_t **tlsp) { + isc_tls_t *tls = NULL; REQUIRE(tlsp != NULL && *tlsp != NULL); - SSL_free(*tlsp); + tls = *tlsp; *tlsp = NULL; + SSL_free(tls); } const char *