#vulnerable code 
                                private static int evalPredict(DecisionTree tree, double[] x) throws HiveException, IOException {
        ArrayList<String> opScript = tree.predictOpCodegen();
        System.out.println(opScript);
        VMTreePredictTrustedUDF udf = new VMTreePredictTrustedUDF();
        udf.initialize(new ObjectInspector[] {
                PrimitiveObjectInspectorFactory.javaStringObjectInspector,
                ObjectInspectorFactory.getStandardListObjectInspector(PrimitiveObjectInspectorFactory.javaDoubleObjectInspector) });
        IntWritable result = (IntWritable) udf.evaluate(opScript, x, true);
        udf.close();
        return result.get();
    } 
                            #location 10 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                private static int evalPredict(DecisionTree tree, double[] x) throws HiveException, IOException {
        ArrayList<String> opScript = tree.predictOpCodegen();
        System.out.println(opScript);
        TreePredictByStackMachineUDF udf = new TreePredictByStackMachineUDF();
        udf.initialize(new ObjectInspector[] {
                PrimitiveObjectInspectorFactory.javaStringObjectInspector,
                ObjectInspectorFactory.getStandardListObjectInspector(PrimitiveObjectInspectorFactory.javaDoubleObjectInspector) });
        IntWritable result = (IntWritable) udf.evaluate(opScript, x, true);
        udf.close();
        return result.get();
    }