diff options
author | unknown <iggy@alf.(none)> | 2007-10-08 22:30:41 -0400 |
---|---|---|
committer | unknown <iggy@alf.(none)> | 2007-10-08 22:30:41 -0400 |
commit | d020488971c0f4417f5c7b9a6688f9dfdf6fec98 (patch) | |
tree | 8b962036d70ff7d64035a769b8599c26b37d407c /client | |
parent | bc8d42f96dc4760bfa843affb343d6b446355296 (diff) | |
download | mariadb-git-d020488971c0f4417f5c7b9a6688f9dfdf6fec98.tar.gz |
Bug#28774 mysql_upgrade creates tempfiles in root-dir (C:\) and
doesn't clean them up
- Make sure to cleanup temporary files after use.
client/mysql_upgrade.c:
Bug#28774 mysql_upgrade creates tempfiles in root-dir (C:\) and
doesn't clean them up
- Close file handle and delete temporary file when write fails.
Diffstat (limited to 'client')
-rw-r--r-- | client/mysql_upgrade.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index 1646f2baf51..02829cd2178 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -456,7 +456,11 @@ static int run_query(const char *query, DYNAMIC_STRING *ds_res, if (my_write(fd, query, strlen(query), MYF(MY_FNABP | MY_WME))) + { + my_close(fd, MYF(0)); + my_delete(query_file_path, MYF(0)); die("Failed to write to '%s'", query_file_path); + } ret= run_tool(mysql_path, ds_res, |