#fixed code
                                @Nonnull
    public byte[] predictSerCodegen(boolean compress) throws HiveException {
        try {
            if (compress) {
                return ObjectUtils.toCompressedBytes(_root);
            } else {
                return ObjectUtils.toBytes(_root);
            }
        } catch (IOException ioe) {
            throw new HiveException("IOException cause while serializing DecisionTree object", ioe);
        } catch (Exception e) {
            throw new HiveException("Exception cause while serializing DecisionTree object", e);
        }
    }
#vulnerable code 
                                @Nonnull
    public byte[] predictSerCodegen(boolean compress) throws HiveException {
        final Attribute[] attrs = _attributes;
        assert (attrs != null);

        FastMultiByteArrayOutputStream bos = new FastMultiByteArrayOutputStream();
        OutputStream wrapped = compress ? new DeflaterOutputStream(bos) : bos;
        ObjectOutputStream oos = null;
        try {
            oos = new ObjectOutputStream(wrapped);
            _root.writeExternal(oos);
            oos.flush();
        } catch (IOException ioe) {
            throw new HiveException("IOException cause while serializing DecisionTree object", ioe);
        } catch (Exception e) {
            throw new HiveException("Exception cause while serializing DecisionTree object", e);
        } finally {
            IOUtils.closeQuietly(oos);
        }
        return bos.toByteArray_clear();
    } 
                            #location 18 
                            #vulnerability type RESOURCE_LEAK