Skip to content

Commit

Permalink
Fixed wrong free in comp_err
Browse files Browse the repository at this point in the history
  • Loading branch information
montywi committed Jul 23, 2020
1 parent d55f8a2 commit 46ffd47
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion extra/comp_err.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ const char *empty_string= ""; /* For empty states */
*/

const char *default_language= "eng";
my_bool default_language_changed= 0;
uint er_offset= 1000;
my_bool info_flag= 0;

Expand Down Expand Up @@ -440,7 +441,8 @@ static void clean_up(struct languages *lang_head, struct errors *error_head)
struct errors *tmp_error, *next_error;
uint count, i;

my_free((void*) default_language);
if (default_language_changed)
my_free((void*) default_language);

for (tmp_lang= lang_head; tmp_lang; tmp_lang= next_language)
{
Expand Down Expand Up @@ -562,6 +564,7 @@ static uint parse_input_file(const char *file_name, struct errors **top_error,
"Failed to parse the default language line. Aborting\n");
DBUG_RETURN(0);
}
default_language_changed= 1;
continue;
}

Expand Down

0 comments on commit 46ffd47

Please sign in to comment.