Commit f67896bb authored by hf@deer.(none)'s avatar hf@deer.(none)

Fix for bug #12177 (error file isn't closed)

parent 4098c40d
......@@ -321,6 +321,7 @@ extern "C"
static my_bool org_my_init_done;
my_bool server_inited;
char ** copy_arguments_ptr= 0;
static FILE *errorlog_file=0;
int STDCALL mysql_server_init(int argc, char **argv, char **groups)
{
......@@ -421,7 +422,7 @@ int STDCALL mysql_server_init(int argc, char **argv, char **groups)
opt_error_log= 1; // Too long file name
else
{
freopen(log_error_file, "a+", stderr);
errorlog_file= freopen(log_error_file, "a+", stderr);
}
}
......@@ -626,6 +627,8 @@ void STDCALL mysql_server_end()
my_free((char*) copy_arguments_ptr, MYF(MY_ALLOW_ZERO_PTR));
copy_arguments_ptr=0;
clean_up(0);
if (errorlog_file)
fclose(errorlog_file);
/* If library called my_init(), free memory allocated by it */
if (!org_my_init_done)
my_end(0);
......
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