summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad MILLER <chad@mysql.com>2008-08-18 12:15:56 -0400
committerChad MILLER <chad@mysql.com>2008-08-18 12:15:56 -0400
commit780fee586ddb0c9c46e848c5204a19e48335a702 (patch)
treefb12be400886c602ca29a322d93ea655271f517d
parentaa04d69e2d9dbef59d441662bc446e3d95a3bf00 (diff)
downloadmariadb-git-780fee586ddb0c9c46e848c5204a19e48335a702.tar.gz
Fix for bug#36399: Double free bug when INFORMATION_SCHEMA
plugin init function fails Problem: if an INFORMATION_SCHEMA plugin initialization fails we free some inner plugin's data (schema_table) twice during the INSTALL PLUGIN command. Fix: free it once.
-rw-r--r--sql/sql_show.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 16a0342cb1f..005eea06e2e 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -6644,17 +6644,15 @@ int initialize_schema_table(st_plugin_int *plugin)
{
sql_print_error("Plugin '%s' init function returned error.",
plugin->name.str);
- goto err;
+ plugin->data= NULL;
+ my_free(schema_table, MYF(0));
+ DBUG_RETURN(1);
}
/* Make sure the plugin name is not set inside the init() function. */
schema_table->table_name= plugin->name.str;
}
-
DBUG_RETURN(0);
-err:
- my_free(schema_table, MYF(0));
- DBUG_RETURN(1);
}
int finalize_schema_table(st_plugin_int *plugin)