fil0fil.c:

  Make allocation for file path more uniform: always use mem_alloc(), not ut_malloc()
parent 0dced9ea
...@@ -2528,7 +2528,7 @@ func_exit: ...@@ -2528,7 +2528,7 @@ func_exit:
#ifdef UNIV_HOTBACKUP #ifdef UNIV_HOTBACKUP
/*********************************************************************** /***********************************************************************
Allocates a file name for an old version of a single-table tablespace. Allocates a file name for an old version of a single-table tablespace.
The string must be freed by caller with ut_free(), NOT with mem_free()! */ The string must be freed by caller with mem_free()! */
static static
char* char*
fil_make_ibbackup_old_name( fil_make_ibbackup_old_name(
...@@ -2538,7 +2538,7 @@ fil_make_ibbackup_old_name( ...@@ -2538,7 +2538,7 @@ fil_make_ibbackup_old_name(
{ {
static const char suffix[] = "_ibbackup_old_vers_"; static const char suffix[] = "_ibbackup_old_vers_";
ulint len = strlen(name); ulint len = strlen(name);
char* path = ut_malloc(len + (15 + sizeof suffix)); char* path = mem_alloc(len + (15 + sizeof suffix));
memcpy(path, name, len); memcpy(path, name, len);
memcpy(path + len, suffix, (sizeof suffix) - 1); memcpy(path + len, suffix, (sizeof suffix) - 1);
...@@ -2570,7 +2570,7 @@ fil_load_single_table_tablespace( ...@@ -2570,7 +2570,7 @@ fil_load_single_table_tablespace(
#ifdef UNIV_HOTBACKUP #ifdef UNIV_HOTBACKUP
fil_space_t* space; fil_space_t* space;
#endif #endif
filepath = ut_malloc(strlen(dbname) + strlen(filename) filepath = mem_alloc(strlen(dbname) + strlen(filename)
+ strlen(fil_path_to_mysql_datadir) + 3); + strlen(fil_path_to_mysql_datadir) + 3);
sprintf(filepath, "%s/%s/%s", fil_path_to_mysql_datadir, dbname, sprintf(filepath, "%s/%s/%s", fil_path_to_mysql_datadir, dbname,
...@@ -2598,7 +2598,7 @@ fil_load_single_table_tablespace( ...@@ -2598,7 +2598,7 @@ fil_load_single_table_tablespace(
"InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf\n" "InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf\n"
"InnoDB: and force InnoDB to continue crash recovery here.\n", filepath); "InnoDB: and force InnoDB to continue crash recovery here.\n", filepath);
ut_free(filepath); mem_free(filepath);
if (srv_force_recovery > 0) { if (srv_force_recovery > 0) {
fprintf(stderr, fprintf(stderr,
...@@ -2633,7 +2633,7 @@ fil_load_single_table_tablespace( ...@@ -2633,7 +2633,7 @@ fil_load_single_table_tablespace(
"InnoDB: and force InnoDB to continue crash recovery here.\n", filepath); "InnoDB: and force InnoDB to continue crash recovery here.\n", filepath);
os_file_close(file); os_file_close(file);
ut_free(filepath); mem_free(filepath);
if (srv_force_recovery > 0) { if (srv_force_recovery > 0) {
fprintf(stderr, fprintf(stderr,
...@@ -2661,7 +2661,7 @@ fil_load_single_table_tablespace( ...@@ -2661,7 +2661,7 @@ fil_load_single_table_tablespace(
(ulong) size_high, (ulong) size_high,
(ulong) size_low, (ulong) (4 * UNIV_PAGE_SIZE)); (ulong) size_low, (ulong) (4 * UNIV_PAGE_SIZE));
os_file_close(file); os_file_close(file);
ut_free(filepath); mem_free(filepath);
return; return;
} }
...@@ -2707,8 +2707,8 @@ fil_load_single_table_tablespace( ...@@ -2707,8 +2707,8 @@ fil_load_single_table_tablespace(
ut_a(os_file_rename(filepath, new_path)); ut_a(os_file_rename(filepath, new_path));
ut_free(buf2); ut_free(buf2);
ut_free(filepath); mem_free(filepath);
ut_free(new_path); mem_free(new_path);
return; return;
} }
...@@ -2743,8 +2743,8 @@ fil_load_single_table_tablespace( ...@@ -2743,8 +2743,8 @@ fil_load_single_table_tablespace(
ut_a(os_file_rename(filepath, new_path)); ut_a(os_file_rename(filepath, new_path));
ut_free(buf2); ut_free(buf2);
ut_free(filepath); mem_free(filepath);
ut_free(new_path); mem_free(new_path);
return; return;
} }
...@@ -2764,7 +2764,7 @@ fil_load_single_table_tablespace( ...@@ -2764,7 +2764,7 @@ fil_load_single_table_tablespace(
func_exit: func_exit:
os_file_close(file); os_file_close(file);
ut_free(buf2); ut_free(buf2);
ut_free(filepath); mem_free(filepath);
} }
/************************************************************************ /************************************************************************
......
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