Kouhei Sutou
null+****@clear*****
Mon Apr 15 00:03:05 JST 2013
Kouhei Sutou 2013-04-15 00:03:05 +0900 (Mon, 15 Apr 2013) New Revision: adb2bc431980a49236aacddf034e6a9439b2cdfb https://github.com/mroonga/mroonga/commit/adb2bc431980a49236aacddf034e6a9439b2cdfb Message: Fix a crash bug by freeing tmp_share tmp_share doesn't have col_flags and col_type. It seems that mrn_table.cpp provides an API that creates tmp_share. Modified files: ha_mroonga.cpp mrn_table.cpp Modified: ha_mroonga.cpp (+4 -0) =================================================================== --- ha_mroonga.cpp 2013-04-15 00:01:36 +0900 (8dffee0) +++ ha_mroonga.cpp 2013-04-15 00:03:05 +0900 (7c3a73d) @@ -13165,6 +13165,8 @@ int ha_mroonga::wrapper_add_index(TABLE *table_arg, KEY *key_info, tmp_share->table_share = &tmp_table_share; tmp_share->key_parser = key_parser; tmp_share->key_parser_length = key_parser_length; + tmp_share->col_flags = NULL; + tmp_share->col_type = NULL; #ifdef MRN_HANDLER_HAVE_FINAL_ADD_INDEX hnd_add_index = NULL; #endif @@ -13293,6 +13295,8 @@ int ha_mroonga::storage_add_index(TABLE *table_arg, KEY *key_info, tmp_share->table_share = &tmp_table_share; tmp_share->key_parser = key_parser; tmp_share->key_parser_length = key_parser_length; + tmp_share->col_flags = NULL; + tmp_share->col_type = NULL; bitmap_clear_all(table->read_set); mrn::PathMapper mapper(share->table_name, mrn_database_path_prefix); for (i = 0; i < num_of_keys; i++) { Modified: mrn_table.cpp (+2 -2) =================================================================== --- mrn_table.cpp 2013-04-15 00:01:36 +0900 (00d5bdb) +++ mrn_table.cpp 2013-04-15 00:03:05 +0900 (6eb741c) @@ -737,9 +737,9 @@ int mrn_free_share_alloc( } for (i = 0; i < share->table_share->fields; i++) { - if (share->col_flags[i]) + if (share->col_flags && share->col_flags[i]) my_free(share->col_flags[i], MYF(0)); - if (share->col_type[i]) + if (share->col_type && share->col_type[i]) my_free(share->col_type[i], MYF(0)); } DBUG_RETURN(0); -------------- next part -------------- HTML����������������������������...Descargar