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

bin/named/lwdnoop.c.  [RT #17476]
This commit is contained in:
Mark Andrews
2008-01-22 01:54:34 +00:00
parent 68461c7c6a
commit 048fdf005a
2 changed files with 12 additions and 10 deletions
+3
View File
@@ -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]
+9 -10
View File
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: lwdnoop.c,v 1.6.208.1 2004/03/06 10:21:19 marka Exp $ */
/* $Id: lwdnoop.c,v 1.6.208.2 2008/01/22 01:54:34 marka Exp $ */
#include <config.h>
@@ -42,7 +42,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 */
@@ -55,7 +55,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;
@@ -63,7 +63,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.
@@ -74,13 +74,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);
}