Commit 8255781d authored by Sergey Vojtovich's avatar Sergey Vojtovich

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.
parent 82a96926
...@@ -4184,9 +4184,12 @@ int ha_mroonga::storage_open(const char *name, int mode, uint test_if_locked) ...@@ -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)) { if (!(ha_thd()->open_options & HA_OPEN_FOR_REPAIR)) {
error = storage_open_indexes(name); error = storage_open_indexes(name);
if (error) { if (error) {
// TODO: free grn_columns and set NULL;
grn_obj_unlink(ctx, grn_table); grn_obj_unlink(ctx, grn_table);
grn_table = NULL; grn_table = NULL;
// TODO: unlink elements
free(grn_columns);
// TODO: unlink elements
free(grn_column_ranges);
DBUG_RETURN(error); DBUG_RETURN(error);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment