From c6733ff655cbf2e0348cc10cf2024f5b061bf5ec Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Wed, 17 Nov 2010 15:26:11 +0200 Subject: [PATCH] Bug #57559: Crash in Client plugin api The plugin code was releasing the plugin and only then was reporting an error referencing it. Fixed by first reporting an error and then freeing up the plugin. --- sql-common/client_plugin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql-common/client_plugin.c b/sql-common/client_plugin.c index bfeea40b401..6114d95cd73 100644 --- a/sql-common/client_plugin.c +++ b/sql-common/client_plugin.c @@ -176,11 +176,11 @@ err2: if (plugin->deinit) plugin->deinit(); err1: - if (dlhandle) - dlclose(dlhandle); set_mysql_extended_error(mysql, CR_AUTH_PLUGIN_CANNOT_LOAD, unknown_sqlstate, ER(CR_AUTH_PLUGIN_CANNOT_LOAD), plugin->name, errmsg); + if (dlhandle) + dlclose(dlhandle); return NULL; }