Added error return in readroute when backend connection fails

This commit is contained in:
Mark Riddoch
2013-06-25 10:38:24 +02:00
parent 6455abdfbd
commit 0227c4afff

View File

@ -210,7 +210,13 @@ int i;
* connection in the client->dcb
*/
client->dcb = dcb_connect(candidate->server, session, candidate->server->protocol);
if ((client->dcb = dcb_connect(candidate->server, session,
candidate->server->protocol)) == NULL)
{
atomic_add(&candidate->count, -1);
free(client);
return NULL;
}
/* Add this session to the list of active sessions */
spinlock_acquire(&inst->lock);