List:Commits« Previous MessageNext Message »
From:Bjorn Munch Date:December 6 2010 1:34pm
Subject:bzr commit into mysql-5.5-mtr branch (bjorn.munch:3123) Bug#58710
View as plain text  
#At file:///home/bm136801/my/valgmt-55/ based on revid:bjorn.munch@stripped

 3123 Bjorn Munch	2010-12-06
      Bug #58710 Valgrind warnings in mysqltest
      Var's string value was not 0-terminated if intially null.
      While at it, also removed some reported memory leaks

    modified:
      client/mysqltest.cc
=== modified file 'client/mysqltest.cc'
--- a/client/mysqltest.cc	2010-11-26 09:57:01 +0000
+++ b/client/mysqltest.cc	2010-12-06 13:32:27 +0000
@@ -2093,10 +2093,9 @@ VAR *var_init(VAR *v, const char *name,
     die("Out of memory");
 
   if (val)
-  {
     memcpy(tmp_var->str_val, val, val_len);
-    tmp_var->str_val[val_len]= 0;
-  }
+  tmp_var->str_val[val_len]= 0;
+
   var_check_int(tmp_var);
   tmp_var->name_len = name_len;
   tmp_var->str_val_len = val_len;
@@ -5053,6 +5052,7 @@ void do_close_connection(struct st_comma
     dynstr_append_mem(ds, ";\n", 2);
   }
 
+  dynstr_free(&ds_connection);
   DBUG_VOID_RETURN;
 }
 
@@ -5481,6 +5481,7 @@ void do_connect(struct st_command *comma
   dynstr_free(&ds_port);
   dynstr_free(&ds_sock);
   dynstr_free(&ds_options);
+  dynstr_free(&ds_default_auth);
 #ifdef HAVE_SMEM
   dynstr_free(&ds_shm);
 #endif
@@ -5729,6 +5730,7 @@ void do_block(enum block_cmd cmd, struct
     }
 
     v.is_int= TRUE;
+    var_free(&v2);
   } else
   {
     if (*expr_start != '`' && ! my_isdigit(charset_info, *expr_start))
@@ -7822,7 +7824,7 @@ void run_query(struct st_connection *cn,
 		     ds, &ds_warnings);
 
   dynstr_free(&ds_warnings);
-  if (command->type == Q_EVAL)
+  if (command->type == Q_EVAL || command->type == Q_SEND_EVAL)
     dynstr_free(&eval_query);
 
   if (display_result_sorted)


Attachment: [text/bzr-bundle] bzr/bjorn.munch@oracle.com-20101206133227-ieblidnt8q5q00an.bundle
Thread
bzr commit into mysql-5.5-mtr branch (bjorn.munch:3123) Bug#58710Bjorn Munch6 Dec