From: Brian Aker Date: Wed, 14 Apr 2010 23:51:37 +0000 (-0700) Subject: Merge Trond. X-Git-Tag: 0.40~10 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=2c225e281b77f404c45493330225c63bbf3c6cc1;p=m6w6%2Flibmemcached Merge Trond. --- 2c225e281b77f404c45493330225c63bbf3c6cc1 diff --cc example/memcached_light.c index 4a53217a,489ec1e4..c059f708 --- a/example/memcached_light.c +++ b/example/memcached_light.c @@@ -319,6 -432,13 +432,13 @@@ int main(int argc, char **argv return 1; } - socket_userdata_map= calloc(maxconns, sizeof(struct connection)); ++ socket_userdata_map= calloc((size_t)(maxconns), sizeof(struct connection)); + if (socket_userdata_map == NULL) + { + fprintf(stderr, "Failed to allocate room for connections\n"); + return 1; + } + memcached_binary_protocol_set_callbacks(protocol_handle, interface); memcached_binary_protocol_set_pedantic(protocol_handle, true);