Fix for bug #54253: memory leak when using I_S plugins w/o deinit method

Free memory allocated by the server for all plugins,
with or without deinit() method.
This commit is contained in:
Ramil Kalimullin 2010-08-27 11:44:06 +04:00
parent fba50f8401
commit 1087cfc4d5

View file

@ -6930,13 +6930,16 @@ int finalize_schema_table(st_plugin_int *plugin)
ST_SCHEMA_TABLE *schema_table= (ST_SCHEMA_TABLE *)plugin->data;
DBUG_ENTER("finalize_schema_table");
if (schema_table && plugin->plugin->deinit)
if (schema_table)
{
DBUG_PRINT("info", ("Deinitializing plugin: '%s'", plugin->name.str));
if (plugin->plugin->deinit(NULL))
if (plugin->plugin->deinit)
{
DBUG_PRINT("warning", ("Plugin '%s' deinit function returned error.",
plugin->name.str));
DBUG_PRINT("info", ("Deinitializing plugin: '%s'", plugin->name.str));
if (plugin->plugin->deinit(NULL))
{
DBUG_PRINT("warning", ("Plugin '%s' deinit function returned error.",
plugin->name.str));
}
}
my_free(schema_table, MYF(0));
}