]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorAndreas Gustafsson <source@isc.org>
Wed, 12 Sep 2001 00:15:11 +0000 (00:15 +0000)
committerAndreas Gustafsson <source@isc.org>
Wed, 12 Sep 2001 00:15:11 +0000 (00:15 +0000)
fix a memory leak on a tsig error condition.

bin/dig/dighost.c

index 106dfe2ebc81f08d6617d0c660c68f742e2b3be2..76ed703c4fdf6bc0634daff8ba205c5088a78e52 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dighost.c,v 1.221 2001/08/08 22:54:14 gson Exp $ */
+/* $Id: dighost.c,v 1.221.2.1 2001/09/12 00:15:11 gson Exp $ */
 
 /*
  * Notice to programmers:  Do not use this code as an example of how to
@@ -930,6 +930,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);
 }
@@ -2246,6 +2249,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++;
@@ -2325,6 +2329,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);