Uploaded image for project: 'Axis2-C'
  1. Axis2-C
  2. AXIS2C-1557

Socket not closed when host name resolution fails in network_handler.c

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.6.0
    • 1.7.0
    • util
    • None
    • QNX 6.4 (built from source WSO2 WSF C++)

    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)

      Attachments

        1. AXIS2C-1557.patch
          0.4 kB
          Chris Steinbeck

        Activity

          People

            samisa Don Samisa Abeysinghe
            sqrpeg Chris Steinbeck
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: