mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Fixed memory leak with RAID tables
Fixed tests for RAID tables Detect uninitialized mutexes on lock and destroy mysql-test/r/raid.result: Updated results mysql-test/r/rpl_change_master.result: Update results missing from last patch mysql-test/t/raid.test: Clean up test mysys/mf_iocache.c: Comments Small safety fix mysys/thr_mutex.c: Detect uninitialized mutexes on lock and destroy sql/sql_db.cc: Fixed memory leak with RAID tables
This commit is contained in:
@@ -440,7 +440,6 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
|
||||
char filePath[FN_REFLEN];
|
||||
TABLE_LIST *tot_list=0, **tot_list_next;
|
||||
List<String> raid_dirs;
|
||||
|
||||
DBUG_ENTER("mysql_rm_known_files");
|
||||
DBUG_PRINT("enter",("path: %s", org_path));
|
||||
|
||||
@@ -516,17 +515,24 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
|
||||
deleted++;
|
||||
}
|
||||
}
|
||||
List_iterator<String> it(raid_dirs);
|
||||
String *dir;
|
||||
|
||||
if (thd->killed ||
|
||||
(tot_list && mysql_rm_table_part2_with_lock(thd, tot_list, 1, 0, 1)))
|
||||
{
|
||||
/* Free memory for allocated raid dirs */
|
||||
while ((dir= it++))
|
||||
delete dir;
|
||||
my_dirend(dirp);
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
List_iterator<String> it(raid_dirs);
|
||||
String *dir;
|
||||
while ((dir= it++))
|
||||
{
|
||||
if (rmdir(dir->c_ptr()) < 0)
|
||||
found_other_files++;
|
||||
delete dir;
|
||||
}
|
||||
my_dirend(dirp);
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user