In NetClientConnect, in connect.c, sockfd is never closed if connect() fails. This can lead to an endless trail of open sockets, if mosaic is spawned multiple times from within a client program.