Test cases now pass
[m6w6/libmemcached] / lib / memcached.c
index c636b9b4e994e938cbcca1d1cd32d4abbdda7b16..6a7715de06cfac8251c7d56a049a1bc5717cb525 100644 (file)
@@ -32,8 +32,9 @@ void memcached_deinit(memcached_st *ptr)
   {
     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);
     }