From: Mark Andrews Date: Thu, 20 Jul 2023 03:10:29 +0000 (+1000) Subject: Take ownership of pointer before freeing X-Git-Tag: v9.19.17~17^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9e2288208de3d3eabac89ee5158f4b94e8ade00f;p=thirdparty%2Fbind9.git Take ownership of pointer before freeing --- diff --git a/lib/isc/tls.c b/lib/isc/tls.c index 314de8b6a60..e6996f43a62 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 *