Commit cef715b6 authored by Mark Andrews's avatar Mark Andrews

2314. [bug] Uninitialized memory use on error path in

                        bin/named/lwdnoop.c.  [RT #17476]
parent 2b58801b
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]
......
......@@ -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);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment