Added a check for candidate server, if NULL return

This commit is contained in:
Massimiliano Pinto 2013-07-31 16:18:45 +02:00
parent 96855a6feb
commit ce8ce5b8fd

View File

@ -56,8 +56,9 @@
* with macros and MySQL commands with MYSQL_ prefix
* avoiding any conflict with the standard ones
* in mysql.h
* 22/07/13 Mark Riddoch Addition of joined router option for Galera
* 22/07/2013 Mark Riddoch Addition of joined router option for Galera
* clusters
* 31/07/2013 Massimiliano Pinto Added a check for candidate server, if NULL return
*
* @endverbatim
*/
@ -296,6 +297,12 @@ int i;
}
}
/* no candidate server here, clean and return NULL */
if (!candidate) {
free(client);
return NULL;
}
/*
* We now have the server with the least connections.
* Bump the connection count for this server