mirror of
https://github.com/MariaDB/server.git
synced 2025-12-15 08:21:24 +03:00
Port r225 from branches/5.0:
Fix memory allocation bug (by changing MY_WME to MY_FAE) in ha_innodb.cc:get_share.
This commit is contained in:
@@ -6787,8 +6787,10 @@ static INNOBASE_SHARE* get_share(const char* table_name)
|
||||
if (!(share=(INNOBASE_SHARE*) hash_search(&innobase_open_tables,
|
||||
(mysql_byte*) table_name,
|
||||
length))) {
|
||||
if ((share=(INNOBASE_SHARE *) my_malloc(sizeof(*share)+length+1,
|
||||
MYF(MY_WME | MY_ZEROFILL)))) {
|
||||
|
||||
share = (INNOBASE_SHARE *) my_malloc(sizeof(*share)+length+1,
|
||||
MYF(MY_FAE | MY_ZEROFILL));
|
||||
|
||||
share->table_name_length=length;
|
||||
share->table_name=(char*) (share+1);
|
||||
strmov(share->table_name,table_name);
|
||||
@@ -6804,7 +6806,6 @@ static INNOBASE_SHARE* get_share(const char* table_name)
|
||||
thr_lock_init(&share->lock);
|
||||
pthread_mutex_init(&share->mutex,MY_MUTEX_INIT_FAST);
|
||||
}
|
||||
}
|
||||
|
||||
share->use_count++;
|
||||
pthread_mutex_unlock(&innobase_share_mutex);
|
||||
|
||||
Reference in New Issue
Block a user