]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2314. [bug] Uninitialized memory use on error path in
authorMark Andrews <marka@isc.org>
Tue, 22 Jan 2008 01:51:16 +0000 (01:51 +0000)
committerMark Andrews <marka@isc.org>
Tue, 22 Jan 2008 01:51:16 +0000 (01:51 +0000)
                        bin/named/lwdnoop.c.  [RT #17476]

CHANGES
bin/named/lwdnoop.c

diff --git a/CHANGES b/CHANGES
index a619aa29ec90c44709ed8d468704c14a59f2253e..48ac9983a9fb5058feaf3305076fb737e72dabc2 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+2314.  [bug]           Uninitialized memory use on error path in
+                       bin/named/lwdnoop.c.  [RT #17476]
+
 2313.  [cleanup]       Silence Coverity warnings. Handle private stacks.
                        [RT #17447] [RT #17478]
 
index 5f5a85fcab0edc59f98b907e48dd5702b0e34571..460bfc09f68b912b6348523cfebdf0f4e80812ed 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: lwdnoop.c,v 1.11 2007/06/19 23:46:59 tbox Exp $ */
+/* $Id: lwdnoop.c,v 1.12 2008/01/22 01:51:16 marka Exp $ */
 
 /*! \file */
 
@@ -44,7 +44,7 @@ ns_lwdclient_processnoop(ns_lwdclient_t *client, lwres_buffer_t *b) {
        result = lwres_nooprequest_parse(client->clientmgr->lwctx,
                                         b, &client->pkt, &req);
        if (result != LWRES_R_SUCCESS)
-               goto out;
+               goto send_error;
 
        client->pkt.recvlength = LWRES_RECVLENGTH;
        client->pkt.authtype = 0; /* XXXMLG */
@@ -57,7 +57,7 @@ ns_lwdclient_processnoop(ns_lwdclient_t *client, lwres_buffer_t *b) {
        lwres = lwres_noopresponse_render(client->clientmgr->lwctx, &resp,
                                          &client->pkt, &lwb);
        if (lwres != LWRES_R_SUCCESS)
-               goto out;
+               goto cleanup_req;
 
        r.base = lwb.base;
        r.length = lwb.used;
@@ -65,7 +65,7 @@ ns_lwdclient_processnoop(ns_lwdclient_t *client, lwres_buffer_t *b) {
        client->sendlength = r.length;
        result = ns_lwdclient_sendreply(client, &r);
        if (result != ISC_R_SUCCESS)
-               goto out;
+               goto cleanup_lwb;
 
        /*
         * We can now destroy request.
@@ -76,13 +76,12 @@ ns_lwdclient_processnoop(ns_lwdclient_t *client, lwres_buffer_t *b) {
 
        return;
 
- out:
-       if (req != NULL)
-               lwres_nooprequest_free(client->clientmgr->lwctx, &req);
+ cleanup_lwb:
+       lwres_context_freemem(client->clientmgr->lwctx, lwb.base, lwb.length);
 
-       if (lwb.base != NULL)
-               lwres_context_freemem(client->clientmgr->lwctx,
-                                     lwb.base, lwb.length);
+ cleanup_req:
+       lwres_nooprequest_free(client->clientmgr->lwctx, &req);
 
+ send_error:
        ns_lwdclient_errorpktsend(client, LWRES_R_FAILURE);
 }