Memory bug in tcpsockets