X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fhosts.c;h=7e68766749e39fa0e1a2b5f97cd8bc37aee4d0d1;hb=2484b956a8b10c71ead82c7ad80c19de6266e807;hp=eafbb1b534ca083e76cb76fc75698403047549fe;hpb=de161b27e5e394ea0ae4a88e58fc9ebb21e821d0;p=awesomized%2Flibmemcached diff --git a/libmemcached/hosts.c b/libmemcached/hosts.c index eafbb1b5..7e687667 100644 --- a/libmemcached/hosts.c +++ b/libmemcached/hosts.c @@ -339,10 +339,15 @@ memcached_return_t memcached_server_push(memcached_st *ptr, const memcached_serv WATCHPOINT_ASSERT(list[x].hostname[0] != 0); instance= memcached_server_instance_fetch(ptr, memcached_server_count(ptr)); + WATCHPOINT_ASSERT(instance); /* TODO check return type */ - (void)memcached_server_create_with(ptr, instance, list[x].hostname, - list[x].port, list[x].weight, list[x].type); + instance= memcached_server_create_with(ptr, instance, list[x].hostname, + list[x].port, list[x].weight, list[x].type); + if (! instance) + { + return memcached_set_error(ptr, MEMCACHED_MEMORY_ALLOCATION_FAILURE, NULL); + } ptr->number_of_hosts++; }