C cleanup, socket