summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorRamil Kalimullin <ramil@mysql.com>2010-08-27 11:44:06 +0400
committerRamil Kalimullin <ramil@mysql.com>2010-08-27 11:44:06 +0400
commit7ebd2cd797f25013e2d2492ef6faa01fbf3cefc2 (patch)
tree93c8fe27b48cbebc8e18b9f60cf161e616a2ca81 /sql/sql_show.cc
parenta4154bd0a04ee863c07848e77ee727b4dc8244e8 (diff)
downloadmariadb-git-7ebd2cd797f25013e2d2492ef6faa01fbf3cefc2.tar.gz
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.
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 3e66cda16e1..e074461b452 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -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));
}