summaryrefslogtreecommitdiff
path: root/sql/ha_federated.cc
diff options
context:
space:
mode:
authormonty@mysql.com <>2005-09-22 03:23:07 +0300
committermonty@mysql.com <>2005-09-22 03:23:07 +0300
commit82fc54781b7694c060418996c6b6a6b5bc4b9df4 (patch)
tree33776d264017bbe56f0deca483d75143bed9762a /sql/ha_federated.cc
parent6f8d3c4844e7f7dd760f09a5ab8ad309d1d690d6 (diff)
downloadmariadb-git-82fc54781b7694c060418996c6b6a6b5bc4b9df4.tar.gz
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
Diffstat (limited to 'sql/ha_federated.cc')
-rw-r--r--sql/ha_federated.cc16
1 files changed, 7 insertions, 9 deletions
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));