bradfitz/gomemcache — pull request #13 by asim (2013-09-09 19:59:28+00:00)
Title: Fix connection leak. Use net.Addr.String() as freeconn map key.

When the function SetServers is called the ServerList is replaced by a new set of net.Addr interfaces which no longer match those used as keys for the freeconn map. The underlying data structure is usually a TCPaddr or UnixAddr pointer. Go's equality operation on the map keys looks at the underlying pointer and thinks they are not the same so continues to create new connections assuming it does not have any free.

The proposed change is to use a string as the map key and call the net.Addr.String() method.