From ce8ce5b8fd8e8797f645a3edc5f7bcd86e8cb59e Mon Sep 17 00:00:00 2001 From: Massimiliano Pinto Date: Wed, 31 Jul 2013 16:18:45 +0200 Subject: [PATCH] Added a check for candidate server, if NULL return --- server/modules/routing/readconnroute.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/server/modules/routing/readconnroute.c b/server/modules/routing/readconnroute.c index 6128f97e3..7cf50d8f5 100644 --- a/server/modules/routing/readconnroute.c +++ b/server/modules/routing/readconnroute.c @@ -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