MDEV-10258 - Valgrind warnings in buildbot after a set of mroonga tests

Fixed memory leak when mroonga fails to open index files.
Memory leak was detected by valgrind when running
mroonga/storage.repair_table_no_index_file.
This commit is contained in:
Sergey Vojtovich 2016-06-20 13:54:19 +04:00
parent 82a96926a7
commit 8255781d9b

View File

@ -4184,9 +4184,12 @@ int ha_mroonga::storage_open(const char *name, int mode, uint test_if_locked)
if (!(ha_thd()->open_options & HA_OPEN_FOR_REPAIR)) {
error = storage_open_indexes(name);
if (error) {
// TODO: free grn_columns and set NULL;
grn_obj_unlink(ctx, grn_table);
grn_table = NULL;
// TODO: unlink elements
free(grn_columns);
// TODO: unlink elements
free(grn_column_ranges);
DBUG_RETURN(error);
}