]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Free struct stub_glue_request in stub_glue_response() callback
authorOndřej Surý <ondrej@isc.org>
Thu, 27 Jul 2023 09:31:06 +0000 (11:31 +0200)
committerOndřej Surý <ondrej@isc.org>
Thu, 27 Jul 2023 10:34:03 +0000 (12:34 +0200)
When stub_glue_response() is called, the associated data is stored in
newly allocated struct stub_glue_request.  The allocated structure is
never freed in the callback, thus we leak a little bit of memory.

lib/dns/zone.c

index dfbdb66040db4c6a76521ee9084b19f7f80449df..e499444a9369f8cdcaab7fc25fde8c135fc770f8 100644 (file)
@@ -12880,6 +12880,7 @@ cleanup:
        }
        dns_name_free(&sgr->name, zone->mctx);
        dns_request_destroy(&request);
+       isc_mem_put(zone->mctx, sgr, sizeof(*sgr));
 
        /* If last request, release all related resources */
        if (atomic_fetch_sub_release(&stub->pending_requests, 1) == 1) {