X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=lib%2Fmemcached.c;h=6cf81c734664d65da4dfa7dd0cd4911658cd39f3;hb=a95ca4ad9c0f9d23c8a83bd337acdecc221021ef;hp=c636b9b4e994e938cbcca1d1cd32d4abbdda7b16;hpb=be683ec76c3d55c427d72d3529f521e479967f6b;p=m6w6%2Flibmemcached diff --git a/lib/memcached.c b/lib/memcached.c index c636b9b4..6cf81c73 100644 --- a/lib/memcached.c +++ b/lib/memcached.c @@ -1,7 +1,7 @@ /* Memcached library */ -#include +#include "common.h" memcached_st *memcached_init(memcached_st *ptr) { @@ -26,14 +26,14 @@ memcached_st *memcached_init(memcached_st *ptr) void memcached_deinit(memcached_st *ptr) { unsigned int x; - memcached_host_st *host_ptr; if (ptr->hosts) { for (x= 0; x < ptr->number_of_hosts; x++) { - if (ptr->hosts[x].fd == -1) + if (ptr->hosts[x].fd > 0) close(ptr->hosts[x].fd); + free(ptr->hosts[x].hostname); }