Bug 166 - NULL pointer dereferenced if candidate server is NULL

This commit is contained in:
Mark Riddoch 2013-08-21 12:08:41 +02:00
parent 2499378af9
commit 4e41fc49f5

View File

@ -264,6 +264,15 @@ static void* newSession(
}
} /* for */
if (candidate == NULL)
{
skygw_log_write_flush(LOGFILE_MESSAGE,
"No suitable servers found for connection.");
free(client);
return NULL;
}
if (inst->master == NULL) {
inst->master = inst->servers[i-1];
}