#vulnerable code 
                             RiakConnection getConnection(boolean setClientId) throws IOException {
        RiakConnection c = connections.get();
        if (c == null || !c.endIdleAndCheckValid()) {
            c = new RiakConnection(addr, port, bufferSizeKb);

            if (this.clientID != null && setClientId) {
                connections.set(c);
                setClientID(clientID);
            }
        }
        connections.set(null);
        return c;
    } 
                            #location 12 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                             RiakConnection getConnection() throws IOException {
        RiakConnection c = pool.getConnection(clientId);
        return c;
    }