mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-29 13:38:26 +00:00
fix a memory leak on a tsig error condition.
This commit is contained in:
parent
36c1674e0a
commit
6eeefeb3eb
@ -15,7 +15,7 @@
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: dighost.c,v 1.222 2001/08/29 18:57:08 gson Exp $ */
|
||||
/* $Id: dighost.c,v 1.223 2001/09/11 22:34:21 bwelling Exp $ */
|
||||
|
||||
/*
|
||||
* Notice to programmers: Do not use this code as an example of how to
|
||||
@ -966,6 +966,9 @@ try_clear_lookup(dig_lookup_t *lookup) {
|
||||
if (lookup->sendspace != NULL)
|
||||
isc_mempool_put(commctx, lookup->sendspace);
|
||||
|
||||
if (lookup->tsigctx != NULL)
|
||||
dst_context_destroy(&lookup->tsigctx);
|
||||
|
||||
isc_mem_free(mctx, lookup);
|
||||
return (ISC_TRUE);
|
||||
}
|
||||
@ -2282,6 +2285,7 @@ recv_done(isc_task_t *task, isc_event_t *event) {
|
||||
result = dns_message_settsigkey(msg, key);
|
||||
check_result(result, "dns_message_settsigkey");
|
||||
msg->tsigctx = l->tsigctx;
|
||||
l->tsigctx = NULL;
|
||||
if (l->msgcounter != 0)
|
||||
msg->tcp_continuation = 1;
|
||||
l->msgcounter++;
|
||||
@ -2361,6 +2365,7 @@ recv_done(isc_task_t *task, isc_event_t *event) {
|
||||
validated = ISC_FALSE;
|
||||
}
|
||||
l->tsigctx = msg->tsigctx;
|
||||
msg->tsigctx = NULL;
|
||||
if (l->querysig != NULL) {
|
||||
debug("freeing querysig buffer %p", l->querysig);
|
||||
isc_buffer_free(&l->querysig);
|
||||
|
Loading…
x
Reference in New Issue
Block a user