From 0a569dfd5ec82693ad11f52291a8dda06900cda6 Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Thu, 4 Jan 2001 01:55:22 +0000 Subject: [PATCH] When saving the query message (for SIG(0) or update forwarding), don't actually do an allocate and copy, since the input buffer stays around. --- lib/dns/message.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/lib/dns/message.c b/lib/dns/message.c index a8556c89ad..cf48d0514a 100644 --- a/lib/dns/message.c +++ b/lib/dns/message.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: message.c,v 1.166 2001/01/04 00:24:26 bwelling Exp $ */ +/* $Id: message.c,v 1.167 2001/01/04 01:55:22 bwelling Exp $ */ /*** *** Imports @@ -558,13 +558,11 @@ msgreset(dns_message_t *msg, isc_boolean_t everything) { } if (msg->query.base != NULL) { - isc_mem_put(msg->mctx, msg->query.base, msg->query.length); msg->query.base = NULL; msg->query.length = 0; } if (msg->saved.base != NULL) { - isc_mem_put(msg->mctx, msg->saved.base, msg->saved.length); msg->saved.base = NULL; msg->saved.length = 0; } @@ -1540,14 +1538,7 @@ dns_message_parse(dns_message_t *msg, isc_buffer_t *source, r.length); } - isc_buffer_usedregion(&origsource, &r); - msg->saved.length = r.length; - msg->saved.base = isc_mem_get(msg->mctx, msg->saved.length); - if (msg->saved.base == NULL) { - msg->saved.length = 0; - return (ISC_R_NOMEMORY); - } - memcpy(msg->saved.base, r.base, msg->saved.length); + isc_buffer_usedregion(&origsource, &msg->saved); if (seen_problem == ISC_TRUE) return (DNS_R_RECOVERABLE);