Fixes CID 10620 by initializing .sin_zero
Fix CID 10770 by checking for NULL
Fix CID 11336 by closing the socket on connect error
Fix CID 11340 by freeing prior to return
Fix CID 11347 by initializing sin_zero to 0
Merge remote-tracking branch 'origin/master'