#vulnerable code 
                                @Test
    public void connectThrowsForUnknownAuthToken()
    {
        ConnectionSettings settings = new ConnectionSettings( mock( AuthToken.class ) );
        TestSocketConnector connector = new TestSocketConnector( settings, insecure(), loggingMock() );

        try
        {
            connector.connect( LOCAL_DEFAULT );
            fail( "Exception expected" );
        }
        catch ( Exception e )
        {
            assertThat( e, instanceOf( ClientException.class ) );
        }
    } 
                            #location 9 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                @Test
    public void connectThrowsForUnknownAuthToken()
    {
        ConnectionSettings settings = new ConnectionSettings( mock( AuthToken.class ) );
        RecordingSocketConnector connector = new RecordingSocketConnector( settings );

        try
        {
            connector.connect( LOCAL_DEFAULT );
            fail( "Exception expected" );
        }
        catch ( Exception e )
        {
            assertThat( e, instanceOf( ClientException.class ) );
        }
    }