From e6729997141e0ed3e8dc80119b4a13948ddbf0d4 Mon Sep 17 00:00:00 2001 From: Andreas Gustafsson Date: Thu, 22 Feb 2001 23:16:59 +0000 Subject: [PATCH] client_create() could return ISC_R_SUCCESS when it failed --- bin/named/client.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/bin/named/client.c b/bin/named/client.c index d5b8277e74..24f4e94360 100644 --- a/bin/named/client.c +++ b/bin/named/client.c @@ -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 @@ -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;