summaryrefslogtreecommitdiff
path: root/sql/repl_failsafe.cc
diff options
context:
space:
mode:
authorKristofer Pettersson <kristofer.pettersson@sun.com>2009-11-20 16:18:01 +0100
committerKristofer Pettersson <kristofer.pettersson@sun.com>2009-11-20 16:18:01 +0100
commit0a686030589dae2fe6bf99f4c3d4a73d4268a491 (patch)
tree2c684f720a7791634409c9607d9ffcd82d0d1b73 /sql/repl_failsafe.cc
parente942adb23dfca74fa8db76dbe40d72f0ceff4818 (diff)
downloadmariadb-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/repl_failsafe.cc')
-rw-r--r--sql/repl_failsafe.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc
index 312499bb4ee..c6a05e93bf4 100644
--- a/sql/repl_failsafe.cc
+++ b/sql/repl_failsafe.cc
@@ -559,7 +559,12 @@ HOSTS";
goto err;
}
si->server_id = log_server_id;
- my_hash_insert(&slave_list, (uchar*)si);
+ if (my_hash_insert(&slave_list, (uchar*)si))
+ {
+ error= "the slave is out of memory";
+ pthread_mutex_unlock(&LOCK_slave_list);
+ goto err;
+ }
}
strmake(si->host, row[1], sizeof(si->host)-1);
si->port = atoi(row[port_ind]);