1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Bug#31382

"Disabled plugin is provoking Valgrind error"
  If there are any auto-alloced string plug-in options, memory is
  allocated during the call for handle_options(). We must free this
  memory if we are not installing the plug-in.
This commit is contained in:
acurtis/antony@xiphis.org/ltamd64.xiphis.org
2007-10-04 10:55:08 -07:00
parent 0f36ce8f86
commit 3060f0be8e
3 changed files with 51 additions and 6 deletions

View File

@@ -3092,7 +3092,7 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp,
{
sql_print_error("Parsing options for plugin '%s' failed.",
tmp->name.str);
DBUG_RETURN(error);
goto err;
}
}
@@ -3102,6 +3102,8 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp,
*enabled= TRUE;
}
error= 1;
if (*enabled)
{
for (opt= tmp->plugin->system_vars; opt && *opt; opt++)
@@ -3140,7 +3142,7 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp,
{
sql_print_error("Plugin '%s' has conflicting system variables",
tmp->name.str);
DBUG_RETURN(1);
goto err;
}
tmp->system_vars= chain.first;
}
@@ -3150,7 +3152,9 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp,
if (enabled_saved && global_system_variables.log_warnings)
sql_print_information("Plugin '%s' disabled by command line option",
tmp->name.str);
DBUG_RETURN(1);
err:
my_cleanup_options(opts);
DBUG_RETURN(error);
}