diff options
author | Bjorn Munch <bjorn.munch@oracle.com> | 2011-01-11 15:23:39 +0100 |
---|---|---|
committer | Bjorn Munch <bjorn.munch@oracle.com> | 2011-01-11 15:23:39 +0100 |
commit | aa5110c0f1766693ef53fa7b5b625fe98eb27479 (patch) | |
tree | 4a4dedb571b9ccd66a9dffc845ccaaa20f0cc9fe /client | |
parent | 2a56b1b000eff658a20392495b368f05fe944643 (diff) | |
download | mariadb-git-aa5110c0f1766693ef53fa7b5b625fe98eb27479.tar.gz |
Bug #59153 mysqltest produces a valgrind warning when the running test fails
Local variable ds_warnings in run_query not cleared.
But when we call die() we don't have access to it.
Set global var. to point to it when allocated.
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqltest.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 63e74cf0b32..6d1630ebdaa 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -468,6 +468,8 @@ TYPELIB command_typelib= {array_elements(command_names),"", command_names, 0}; DYNAMIC_STRING ds_res; +/* Points to ds_warning in run_query, so it can be freed */ +DYNAMIC_STRING *ds_warn= 0; char builtin_echo[FN_REFLEN]; @@ -1275,6 +1277,8 @@ void free_used_memory() my_free(embedded_server_args[--embedded_server_arg_count]); delete_dynamic(&q_lines); dynstr_free(&ds_res); + if (ds_warn) + dynstr_free(ds_warn); free_all_replace(); my_free(opt_pass); free_defaults(default_argv); @@ -7693,6 +7697,8 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags) die ("Cannot reap on a connection without pending send"); init_dynamic_string(&ds_warnings, NULL, 0, 256); + ds_warn= &ds_warnings; + /* Evaluate query if this is an eval command */ @@ -7850,6 +7856,7 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags) ds, &ds_warnings); dynstr_free(&ds_warnings); + ds_warn= 0; if (command->type == Q_EVAL || command->type == Q_SEND_EVAL) dynstr_free(&eval_query); |