summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorunknown <iggy@alf.(none)>2007-10-08 22:30:41 -0400
committerunknown <iggy@alf.(none)>2007-10-08 22:30:41 -0400
commitd020488971c0f4417f5c7b9a6688f9dfdf6fec98 (patch)
tree8b962036d70ff7d64035a769b8599c26b37d407c /client
parentbc8d42f96dc4760bfa843affb343d6b446355296 (diff)
downloadmariadb-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.c4
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,