]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Take ownership of pointer before freeing
authorMark Andrews <marka@isc.org>
Thu, 20 Jul 2023 03:10:29 +0000 (13:10 +1000)
committerMark Andrews <marka@isc.org>
Fri, 1 Sep 2023 02:01:20 +0000 (12:01 +1000)
lib/isc/tls.c

index 314de8b6a601821323565da21ab8a18481a479f7..e6996f43a621f5be5c4bc0827b4aa5da552661e9 100644 (file)
@@ -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 *