[SOCK]: on failure free the sock from the right place