1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Backport BUG#38468 Memory leak detected when using mysqlbinlog utility

There were two memory leaks in mysqlbinlog command, one was already
fixed by previous patches, another one was that defaults_argv was
set to the value of argv after parse_args, in which called
handle_options after calling load_defaults and changed the value
of argv, and caused the memory allocated for defaults arguments
not freed.

Fixed the problem by setting defaults_argv right after calling
load_defaults.
This commit is contained in:
He Zhenxing
2009-10-02 16:18:40 +08:00
parent 494adde6fb
commit 4354cfd404
2 changed files with 26 additions and 2 deletions

View File

@ -1346,7 +1346,6 @@ static int parse_args(int *argc, char*** argv)
int ho_error;
result_file = stdout;
load_defaults("my",load_default_groups,argc,argv);
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
exit(ho_error);
if (debug_info_flag)
@ -1998,8 +1997,9 @@ int main(int argc, char** argv)
my_init_time(); // for time functions
load_defaults("my", load_default_groups, &argc, &argv);
defaults_argv= argv;
parse_args(&argc, (char***)&argv);
defaults_argv=argv;
if (!argc)
{