client_create() could return ISC_R_SUCCESS when it failed
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: client.c,v 1.151 2001/02/14 03:50:04 gson Exp $ */
|
||||
/* $Id: client.c,v 1.152 2001/02/22 23:16:59 gson Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -1531,20 +1531,26 @@ client_create(ns_clientmgr_t *manager, ns_client_t **clientp)
|
||||
ISC_SOCKEVENT_SENDDONE,
|
||||
client_senddone, client,
|
||||
sizeof(isc_socketevent_t));
|
||||
if (client->sendevent == NULL)
|
||||
if (client->sendevent == NULL) {
|
||||
result = ISC_R_NOMEMORY;
|
||||
goto cleanup_sendbuf;
|
||||
}
|
||||
|
||||
client->recvbuf = isc_mem_get(manager->mctx, RECV_BUFFER_SIZE);
|
||||
if (client->recvbuf == NULL)
|
||||
if (client->recvbuf == NULL) {
|
||||
result = ISC_R_NOMEMORY;
|
||||
goto cleanup_sendevent;
|
||||
}
|
||||
|
||||
client->recvevent = (isc_socketevent_t *)
|
||||
isc_event_allocate(manager->mctx, client,
|
||||
ISC_SOCKEVENT_RECVDONE,
|
||||
client_request, client,
|
||||
sizeof(isc_socketevent_t));
|
||||
if (client->recvevent == NULL)
|
||||
if (client->recvevent == NULL) {
|
||||
result = ISC_R_NOMEMORY;
|
||||
goto cleanup_recvbuf;
|
||||
}
|
||||
|
||||
client->magic = NS_CLIENT_MAGIC;
|
||||
client->mctx = manager->mctx;
|
||||
|
||||
Reference in New Issue
Block a user