#fixed code
                                @Test
    public void testExecuteAndFetch(){
        createAndFillUserTable();

        try (Connection con = sql2o.open()) {

            Date before = new Date();
            List<User> allUsers = con.createQuery("select * from User").executeAndFetch(User.class);


            assertNotNull(allUsers);

            Date after = new Date();
            long span = after.getTime() - before.getTime();
            System.out.println(String.format("Fetched %s user: %s ms", insertIntoUsers, span));

            // repeat this
            before = new Date();
            allUsers = con.createQuery("select * from User").executeAndFetch(User.class);
            after = new Date();
            span = after.getTime() - before.getTime();
            System.out.println(String.format("Again Fetched %s user: %s ms", insertIntoUsers, span));

            assertTrue(allUsers.size() == insertIntoUsers);

        }
        deleteUserTable();
    }
#vulnerable code 
                                @Test
    public void testExecuteAndFetch(){
        createAndFillUserTable();

        Date before = new Date();
        List<User> allUsers = sql2o.createQuery("select * from User").executeAndFetch(User.class);
        Date after = new Date();
        long span = after.getTime() - before.getTime();
        System.out.println(String.format("Fetched %s user: %s ms", insertIntoUsers, span));

        // repeat this
        before = new Date();
        allUsers = sql2o.createQuery("select * from User").executeAndFetch(User.class);
        after = new Date();
        span = after.getTime() - before.getTime();
        System.out.println(String.format("Again Fetched %s user: %s ms", insertIntoUsers, span));

        assertTrue(allUsers.size() == insertIntoUsers);
        deleteUserTable();
    } 
                            #location 6 
                            #vulnerability type RESOURCE_LEAK