#fixed code
                                static InsecureStore clone(InsecureStore inputStore)
    {
        ByteArrayOutputStream baos = null;
        ByteArrayInputStream bais = null;
        try
        {
            baos = new ByteArrayOutputStream();

            inputStore.toXml(baos);

            final String xmlString = baos.toString();

            bais = new ByteArrayInputStream(xmlString.getBytes());
            final InsecureStore result = InsecureStore.fromXml(bais);

            return result;
        }
        finally
        {
            IOUtils.closeQuietly(baos);
            IOUtils.closeQuietly(bais);
        }
    }
#vulnerable code 
                                static InsecureStore clone(InsecureStore inputStore)
    {
        ByteArrayOutputStream baos = null;
        ByteArrayInputStream bais = null;
        try
        {
            baos = new ByteArrayOutputStream();
            final PrintStream ps = new PrintStream(baos);

            inputStore.toXml(ps);
            ps.flush();

            final String xmlString = baos.toString();

            bais = new ByteArrayInputStream(xmlString.getBytes());
            final InsecureStore result = InsecureStore.fromXml(bais);

            return result;
        }
        finally
        {
            IOUtils.closeQuietly(baos);
            IOUtils.closeQuietly(bais);
        }
    } 
                            #location 11 
                            #vulnerability type RESOURCE_LEAK