Details
Description
This is a boundary case but we found that when the host name could not be resolved the a socket was leaked and the server eventually exceeded the maximum number of open files.
The leak is in axutil_network_handler_open_socket in network_handler.c. The socket is created on line 68 (non-Win32) and receives a file descriptor. If the server is identified by a host name as opposed to an IP address the call to getbyhostname should resolve the name. If this call fails, AXIS2_INVALID_SOCKET is returned on line 99 but the file descriptor is not closed. A call to AXIS2_CLOSE_SOCKET should be added - as is done in the next error case on lines 108-110.
(Line numbers based on Axis2/C 1.6 and confirmed in trunk revision 1152415)