List:Commits« Previous MessageNext Message »
From:Ramil Kalimullin Date:August 18 2008 10:27am
Subject:bzr commit into mysql-5.1 branch (ramil:2709) Bug#36399
View as plain text  
#At file:///home/ram/mysql/b36399.5.1/

 2709 Ramil Kalimullin	2008-08-18
      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.
modified:
  sql/sql_show.cc

per-file messages:
  sql/sql_show.cc
    Fix for bug#36399: Double free bug when INFORMATION_SCHEMA
    plugin init function fails
      - null plugin->data if INFORMATION_SCHEMA initialization
        fails to prevent the second free(schema_table) call
        in finalize_schema_table().
=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc	2008-08-15 20:42:29 +0000
+++ b/sql/sql_show.cc	2008-08-18 08:27:00 +0000
@@ -6644,17 +6644,15 @@ int initialize_schema_table(st_plugin_in
     {
       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)

Thread
bzr commit into mysql-5.1 branch (ramil:2709) Bug#36399Ramil Kalimullin18 Aug