diff options
author | Kristofer Pettersson <kristofer.pettersson@sun.com> | 2009-11-20 16:18:01 +0100 |
---|---|---|
committer | Kristofer Pettersson <kristofer.pettersson@sun.com> | 2009-11-20 16:18:01 +0100 |
commit | 0a686030589dae2fe6bf99f4c3d4a73d4268a491 (patch) | |
tree | 2c684f720a7791634409c9607d9ffcd82d0d1b73 /sql/sql_base.cc | |
parent | e942adb23dfca74fa8db76dbe40d72f0ceff4818 (diff) | |
download | mariadb-git-0a686030589dae2fe6bf99f4c3d4a73d4268a491.tar.gz |
Bug#45613 handle failures from my_hash_insert
Not all my_hash_insert() calls are checked for return value.
This patch adds appropriate checks and failure responses
where needed.
mysys/hash.c:
* Debug hook for testing failures in my_hash_insert()
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r-- | sql/sql_base.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc index e706bd04ea6..a421ca584ff 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2933,7 +2933,12 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root, DBUG_PRINT("info", ("inserting table '%s'.'%s' 0x%lx into the cache", table->s->db.str, table->s->table_name.str, (long) table)); - VOID(my_hash_insert(&open_cache,(uchar*) table)); + if (my_hash_insert(&open_cache,(uchar*) table)) + { + my_free(table, MYF(0)); + VOID(pthread_mutex_unlock(&LOCK_open)); + DBUG_RETURN(NULL); + } } check_unused(); // Debugging call |