Fix CID 11347 by initializing sin_zero to 0
Fix CID 11340 by freeing prior to return
Fix CID 11336 by closing the socket on connect error
Fix CID 10770 by checking for NULL
Fixes CID 10620 by initializing .sin_zero