]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorAndreas Gustafsson <source@isc.org>
Fri, 15 Jun 2001 17:02:18 +0000 (17:02 +0000)
committerAndreas Gustafsson <source@isc.org>
Fri, 15 Jun 2001 17:02:18 +0000 (17:02 +0000)
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().

lib/dns/message.c

index a943f0d9dce639c53e8cd1d54f455420ca6fde08..1ca85bd0cd8c32e50c86c296730c6117786bb4dd 100644 (file)
@@ -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;