Skip to content

Commit 8255781

Browse files
committed
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.
1 parent 82a9692 commit 8255781

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

storage/mroonga/ha_mroonga.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4184,9 +4184,12 @@ int ha_mroonga::storage_open(const char *name, int mode, uint test_if_locked)
41844184
if (!(ha_thd()->open_options & HA_OPEN_FOR_REPAIR)) {
41854185
error = storage_open_indexes(name);
41864186
if (error) {
4187-
// TODO: free grn_columns and set NULL;
41884187
grn_obj_unlink(ctx, grn_table);
41894188
grn_table = NULL;
4189+
// TODO: unlink elements
4190+
free(grn_columns);
4191+
// TODO: unlink elements
4192+
free(grn_column_ranges);
41904193
DBUG_RETURN(error);
41914194
}
41924195

0 commit comments

Comments
 (0)