List:Commits« Previous MessageNext Message »
From:Bjorn Munch Date:January 4 2011 1:07pm
Subject:bzr commit into mysql-5.5-mtr branch (bjorn.munch:3135) Bug#59153
View as plain text  
#At file:///home/bm136801/my/mtleak-55/ based on revid:bjorn.munch@stripped

 3135 Bjorn Munch	2011-01-04
      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.

    modified:
      client/mysqltest.cc
=== modified file 'client/mysqltest.cc'
--- a/client/mysqltest.cc	2010-12-29 15:28:19 +0000
+++ b/client/mysqltest.cc	2011-01-04 13:06:05 +0000
@@ -468,6 +468,8 @@ TYPELIB command_typelib= {array_elements
 			  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);
@@ -7679,6 +7683,8 @@ void run_query(struct st_connection *cn,
     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
   */
@@ -7836,6 +7842,7 @@ void run_query(struct st_connection *cn,
 		     ds, &ds_warnings);
 
   dynstr_free(&ds_warnings);
+  ds_warn= 0;
   if (command->type == Q_EVAL || command->type == Q_SEND_EVAL)
     dynstr_free(&eval_query);
 


Attachment: [text/bzr-bundle] bzr/bjorn.munch@oracle.com-20110104130605-uxl34yyq5ksaxlyv.bundle
Thread
bzr commit into mysql-5.5-mtr branch (bjorn.munch:3135) Bug#59153Bjorn Munch4 Jan