From: Date: Fri, 29 Feb 2008 07:30:56 +0000 (-0800) Subject: Fix from Charles Aylward for reuse of buffer. X-Git-Tag: _20~1^2~55^2~1^2~1 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=dbce10442220e3c776226a3a2f4050cb6bcfbe42;p=m6w6%2Flibmemcached Fix from Charles Aylward for reuse of buffer. --- diff --git a/lib/memcached_storage.c b/lib/memcached_storage.c index 2a0f88d4..aac9b922 100644 --- a/lib/memcached_storage.c +++ b/lib/memcached_storage.c @@ -91,6 +91,8 @@ static inline memcached_return memcached_send(memcached_st *ptr, do { + char response_buffer[MEMCACHED_DEFAULT_COMMAND_SIZE]; + rc[replicas]= memcached_do(&ptr->hosts[server_key], buffer, write_length, 0); if (rc[replicas] != MEMCACHED_SUCCESS) @@ -111,7 +113,8 @@ static inline memcached_return memcached_send(memcached_st *ptr, if (to_write == 0) return MEMCACHED_BUFFERED; else - rc[replicas]= memcached_response(&ptr->hosts[server_key], buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, NULL); + rc[replicas]= memcached_response(&ptr->hosts[server_key], + response_buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, NULL); /* On error we just jump to the next potential server */ error: