#fixed code
                                public void template(String filename, final ConcurrentHashMap<String, KeyValuePair> map) {
        try {
            Replicator replicator = new RedisReplicator(RdbParserTest.class.
                    getClassLoader().getResourceAsStream(filename)
                    , FileType.RDB, Configuration.defaultSetting());
            replicator.addRdbListener(new RdbListener.Adaptor() {
                @Override
                public void handle(Replicator replicator, KeyValuePair<?> kv) {
                    map.put(kv.getKey(), kv);
                }
            });
            replicator.open();
        } catch (Exception e) {
            TestCase.fail();
        }
    }
#vulnerable code 
                                public void template(String filename, final ConcurrentHashMap<String, KeyValuePair> map) {
        try {
            Replicator replicator = new RedisReplicator(RdbParserTest.class.
                    getClassLoader().getResourceAsStream(filename)
                    , Configuration.defaultSetting());
            replicator.addRdbListener(new RdbListener.Adaptor() {
                @Override
                public void handle(Replicator replicator, KeyValuePair<?> kv) {
                    map.put(kv.getKey(), kv);
                }
            });
            replicator.open();
        } catch (Exception e) {
            TestCase.fail();
        }
    } 
                            #location 12 
                            #vulnerability type RESOURCE_LEAK