0 is valid return value from socket(). leaked_handle: Handle variable "fd" going out of scope leaks the handle.