tsig keys were not properly ref counted
This commit is contained in:
Andreas Gustafsson
2000-07-28 05:37:34 +00:00
parent f2e2554527
commit 9320acde61
2 changed files with 13 additions and 3 deletions

View 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));

View 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);