projects
/
m6w6
/
libmemcached
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
github
raw
|
patch
|
inline
| side by side (parent:
53774ee
)
Fix issue with checking on hosts when building new list.
author
Brian Aker
<brian@tangent.org>
Thu, 7 Apr 2011 22:59:30 +0000
(15:59 -0700)
committer
Brian Aker
<brian@tangent.org>
Thu, 7 Apr 2011 22:59:30 +0000
(15:59 -0700)
libmemcached/hosts.c
patch
|
blob
|
history
diff --git
a/libmemcached/hosts.c
b/libmemcached/hosts.c
index eafbb1b534ca083e76cb76fc75698403047549fe..7e68766749e39fa0e1a2b5f97cd8bc37aee4d0d1 100644
(file)
--- 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(list[x].hostname[0] != 0);
instance= memcached_server_instance_fetch(ptr, memcached_server_count(ptr));
+ WATCHPOINT_ASSERT(instance);
/* TODO check return type */
/* 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++;
}
ptr->number_of_hosts++;
}