Fixed #3535 (Leaking socket)