]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorAndreas Gustafsson <source@isc.org>
Fri, 28 Jul 2000 05:37:34 +0000 (05:37 +0000)
committerAndreas Gustafsson <source@isc.org>
Fri, 28 Jul 2000 05:37:34 +0000 (05:37 +0000)
tsig keys were not properly ref counted

lib/dns/request.c
lib/dns/zone.c

index 26d628978dec50ae4d31ef3b93b6b1c3c1686cb2..f875f4cfa2b9165fbadd6c6f0a810e9814318229 100644 (file)
@@ -15,7 +15,7 @@
  * SOFTWARE.
  */
 
-/* $Id: request.c,v 1.26.2.1 2000/07/21 22:26:16 gson Exp $ */
+/* $Id: request.c,v 1.26.2.2 2000/07/28 05:37:34 gson Exp $ */
 
 #include <config.h>
 
@@ -493,7 +493,8 @@ dns_request_create(dns_requestmgr_t *requestmgr, dns_message_t *message,
        request->event->ev_sender = task;
        request->event->request = request;
        request->event->result = ISC_R_FAILURE;
-       request->tsigkey = key;
+       if (key != NULL)
+               dns_tsigkey_attach(key, &request->tsigkey);
        
  use_tcp:
        if ((options & DNS_REQUESTOPT_TCP) != 0) {
@@ -934,6 +935,8 @@ req_destroy(dns_request_t *request) {
                isc_timer_detach(&request->timer);
        if (request->tsig != NULL)
                isc_buffer_free(&request->tsig);
+       if (request->tsigkey != NULL)
+               dns_tsigkey_detach(&request->tsigkey);
        requestmgr_detach(&request->requestmgr);
        mctx = request->mctx;
        isc_mem_put(mctx, request, sizeof(*request));
index 90db03b6fa5e162a2d0ecff4eddd46af5341f70c..fb74a93313f0a5df1118b1e4881d668ec7bdd082 100644 (file)
@@ -15,7 +15,7 @@
  * SOFTWARE.
  */
 
-/* $Id: zone.c,v 1.152.2.2 2000/07/10 22:43:38 gson Exp $ */
+/* $Id: zone.c,v 1.152.2.3 2000/07/28 05:37:31 gson Exp $ */
 
 #include <config.h>
 
@@ -1791,6 +1791,8 @@ notify_send_toaddr(isc_task_t *task, isc_event_t *event) {
                                    notify->zone->task,
                                    notify_done, notify,
                                    &notify->request);
+       if (key != NULL)
+               dns_tsigkey_detach(&key);
        dns_message_destroy(&message);
  cleanup:
        if (result != ISC_R_SUCCESS)
@@ -2650,6 +2652,8 @@ soa_query(isc_task_t *task, isc_event_t *event) {
                         dns_result_totext(result));
                goto cleanup;
        }
+       if (key != NULL)
+               dns_tsigkey_detach(&key);
        dns_message_destroy(&message);
        isc_event_free(&event);
        dns_zone_idetach(&zone);
@@ -3952,6 +3956,9 @@ got_transfer_quota(isc_task_t *task, isc_event_t *event) {
         */
        if (result != ISC_R_SUCCESS)
                zone_xfrdone(zone, result);
+
+       if (tsigkey != NULL)
+               dns_tsigkey_detach(&tsigkey);
        
        isc_event_free(&event);