X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=lib%2Fmemcached_stats.c;h=1e3c425b0df693e27180a7335e1cd50f4e0cdcab;hb=a95ca4ad9c0f9d23c8a83bd337acdecc221021ef;hp=ed2c0e20ffc2d4d7577ae57184eeb3b13e89f236;hpb=806525899ce3dff894b829416307a4290cd882e2;p=m6w6%2Flibmemcached diff --git a/lib/memcached_stats.c b/lib/memcached_stats.c index ed2c0e20..1e3c425b 100644 --- a/lib/memcached_stats.c +++ b/lib/memcached_stats.c @@ -1,7 +1,7 @@ /* */ -#include +#include "common.h" static char *memcached_stat_keys[] = { "pid", @@ -240,7 +240,7 @@ static memcached_return memcached_stats_fetch(memcached_st *ptr, if (send_length >= MEMCACHED_DEFAULT_COMMAND_SIZE) return MEMCACHED_WRITE_FAILURE; - sent_length= write(ptr->hosts[server_key].fd, buffer, send_length); + sent_length= send(ptr->hosts[server_key].fd, buffer, send_length, 0); if (sent_length == -1 || sent_length != send_length) return MEMCACHED_WRITE_FAILURE; @@ -338,6 +338,8 @@ char ** memcached_stat_get_keys(memcached_st *ptr, memcached_stat_st *stat, { char **list= (char **)malloc(sizeof(memcached_stat_keys)); + memset(list, 0, sizeof(memcached_stat_keys)); + if (!list) { *error= MEMCACHED_MEMORY_ALLOCATION_FAILURE;