Skip to content

Commit

Permalink
Fixed memory leak in mysqltest
Browse files Browse the repository at this point in the history
read_command_buf was not freed at exit, which could cause a warning from
valgrind
  • Loading branch information
montywi committed Mar 11, 2019
1 parent 814205f commit f010c90
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion client/mysqltest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ static char TMPDIR[FN_REFLEN];
static char global_subst_from[200];
static char global_subst_to[200];
static char *global_subst= NULL;
static char *read_command_buf= NULL;
static MEM_ROOT require_file_root;
static const my_bool my_true= 1;
static const my_bool my_false= 0;
Expand Down Expand Up @@ -1532,6 +1533,7 @@ void free_used_memory()
free_defaults(default_argv);
free_root(&require_file_root, MYF(0));
free_re();
my_free(read_command_buf);
#ifdef _WIN32
free_tmp_sh_file();
free_win_path_patterns();
Expand Down Expand Up @@ -6583,7 +6585,6 @@ static inline bool is_escape_char(char c, char in_string)
*/

static char *read_command_buf= NULL;
static size_t read_command_buflen= 0;
static const size_t max_multibyte_length= 6;

Expand Down

0 comments on commit f010c90

Please sign in to comment.