#vulnerable code 
                                private void warmUp() throws IOException {
        if (permits.tryAcquire(initialSize)) {
            for (int i = 0; i < this.initialSize; i++) {
                RiakConnection c = 
                    new RiakConnection(this.host, this.port, 
                                       this.bufferSizeKb, this, 
                                       TimeUnit.MILLISECONDS.convert(connectionWaitTimeoutNanos, TimeUnit.NANOSECONDS), 
                                       requestTimeoutMillis);
                c.beginIdle();
                available.add(c);
            }
        } else {
            throw new RuntimeException("Unable to create initial connections");
        }
    } 
                            #location 10 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                private void warmUp() throws IOException {
        
        for (int i = 0; i < this.initialSize; i++) {
            RiakConnection c = getConnection();
            c.beginIdle();
            available.add(c);
        }
        
    }