#vulnerable code 
                                @Override
    public final Connection connect( BoltServerAddress address )
    {
        Connection connection = createConnection( address, securityPlan, logging );

        // Because SocketConnection is not thread safe, wrap it in this guard
        // to ensure concurrent access leads causes application errors
        connection = new ConcurrencyGuardingConnection( connection );

        connection.init( connectionSettings.userAgent(), tokenAsMap( connectionSettings.authToken() ) );
        return connection;
    } 
                            #location 11 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                @Override
    public final Connection connect( BoltServerAddress address )
    {
        Connection connection = createConnection( address, securityPlan, logging );

        // Because SocketConnection is not thread safe, wrap it in this guard
        // to ensure concurrent access leads causes application errors
        connection = new ConcurrencyGuardingConnection( connection );

        try
        {
            connection.init( connectionSettings.userAgent(), tokenAsMap( connectionSettings.authToken() ) );
        }
        catch ( Throwable initError )
        {
            connection.close();
            throw initError;
        }

        return connection;
    }