Added tag 0.2 for changeset 72b98d8bc30e
[awesomized/libmemcached] / lib / memcached.c
index c636b9b4e994e938cbcca1d1cd32d4abbdda7b16..8122e1e837876156fe8dc5d4a192d5fdadb26d7e 100644 (file)
@@ -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);
     }