From: Andreas Gustafsson Date: Fri, 15 Jun 2001 17:02:18 +0000 (+0000) Subject: pullup: X-Git-Tag: v9.1.3rc2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa6773e6ad393d14c6adaac02bfe335763bdb832;p=thirdparty%2Fbind9.git pullup: When doing best-effort parsing (in dig, for example) on a message with multiple questions where an unrecoverable error is seen after 2 or more questions have been parsed, memory would be leaked from msg->namepool, and would trigger an ENSURE() in dns_message_destroy(). --- diff --git a/lib/dns/message.c b/lib/dns/message.c index a943f0d9dce..1ca85bd0cd8 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.164.2.6 2001/06/14 14:36:04 gson Exp $ */ +/* $Id: message.c,v 1.164.2.7 2001/06/15 17:02:18 gson Exp $ */ /*** *** Imports @@ -962,11 +962,10 @@ getquestions(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx, * need this name pointer. */ if (result != ISC_R_SUCCESS) { - if (ISC_LIST_EMPTY(*section)) { - ISC_LIST_APPEND(*section, name, link); - free_name = ISC_FALSE; - } else + if (!ISC_LIST_EMPTY(*section)) DO_FORMERR; + ISC_LIST_APPEND(*section, name, link); + free_name = ISC_FALSE; } else { isc_mempool_put(msg->namepool, name); name = name2;