#vulnerable code 
                                public void evaluateBlock(String blockName, Writer writer, Map<String, Object> map, Locale locale) throws PebbleException, IOException {
        EvaluationContext context = this.initContext(locale);
        context.getScopeChain().pushScope(map);

        final Writer nowhere = new Writer() {
            public void write(char[] cbuf, int off, int len) throws IOException {}
            public void flush() throws IOException {}
            public void close() throws IOException {}
        };
        this.evaluate(nowhere, context);

        this.block(writer, context, blockName, false);
        writer.flush();
    } 
                            #location 10 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                public void evaluateBlock(String blockName, Writer writer, Map<String, Object> map, Locale locale) throws PebbleException, IOException {
        EvaluationContext context = this.initContext(locale);
        context.getScopeChain().pushScope(map);

        this.evaluate(new NoopWriter(), context);
        this.block(writer, context, blockName, false);

        writer.flush();
    }