#vulnerable code 
                                @Test
    public void testEmptyChunkedInputStream() throws IOException {
        final String input = "0\r\n";
        final InputStream in = new ChunkedInputStream(
                new SessionInputBufferMock(input, Consts.ISO_8859_1));
        final byte[] buffer = new byte[300];
        final ByteArrayOutputStream out = new ByteArrayOutputStream();
        int len;
        while ((len = in.read(buffer)) > 0) {
            out.write(buffer, 0, len);
        }
        Assert.assertEquals(0, out.size());
    } 
                            #location 12 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                @Test
    public void testEmptyChunkedInputStream() throws IOException {
        final String input = "0\r\n";
        final InputStream in = new ChunkedInputStream(
                new SessionInputBufferMock(input, Consts.ISO_8859_1));
        final byte[] buffer = new byte[300];
        final ByteArrayOutputStream out = new ByteArrayOutputStream();
        int len;
        while ((len = in.read(buffer)) > 0) {
            out.write(buffer, 0, len);
        }
        Assert.assertEquals(0, out.size());
        in.close();
    }