From 82fc54781b7694c060418996c6b6a6b5bc4b9df4 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Thu, 22 Sep 2005 03:23:07 +0300 Subject: Fixed problems found by valgrind Fixed problems in test suite where some test failed Fixed access to not initialized memory in federated Fixed access to not initialized memory when using BIT fields in internal temporary tables --- sql/ha_federated.cc | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'sql/ha_federated.cc') diff --git a/sql/ha_federated.cc b/sql/ha_federated.cc index 6230fa7bb3c..6d5c5b48ab6 100644 --- a/sql/ha_federated.cc +++ b/sql/ha_federated.cc @@ -588,12 +588,14 @@ static int parse_url(FEDERATED_SHARE *share, TABLE *table, DBUG_ENTER("ha_federated::parse_url"); share->port= 0; + share->socket= 0; DBUG_PRINT("info", ("Length %d \n", table->s->connect_string.length)); DBUG_PRINT("info", ("String %.*s \n", table->s->connect_string.length, table->s->connect_string.str)); - share->scheme= my_strdup_with_length( - (const byte*)table->s->connect_string.str, - table->s->connect_string.length+1, MYF(0)); + share->scheme= my_strdup_with_length((const byte*)table->s-> + connect_string.str, + table->s->connect_string.length, + MYF(0)); // Add a null for later termination of table name share->scheme[table->s->connect_string.length]= 0; @@ -1375,13 +1377,9 @@ static int free_share(FEDERATED_SHARE *share) if (!--share->use_count) { - if (share->scheme) - { - my_free((gptr) share->scheme, MYF(0)); - share->scheme= 0; - } - hash_delete(&federated_open_tables, (byte*) share); + my_free((gptr) share->scheme, MYF(MY_ALLOW_ZERO_PTR0)); + share->scheme= 0; thr_lock_delete(&share->lock); VOID(pthread_mutex_destroy(&share->mutex)); my_free((gptr) share, MYF(0)); -- cgit v1.2.1