#vulnerable code 
                                public static void explore(File m) {

        String mac = "open ";


        String cmd = null;
        switch(Platform.getPlatform())
        {

            case mac:
                cmd = "open ";
                if (!m.isDirectory()) cmd += "-R ";
                break;
            case win:
                cmd = "Explorer /select, ";
                break;
            case linux:
                cmd = "gnome-open PATH ";
                break;
        }

        if (cmd != null) {
            cmd += "\"" + m.getAbsolutePath() + "\"";
            System.err.println(cmd);
            try {
                Runtime.getRuntime().exec(cmd);
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

    } 
                            #location 26 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                public static void explore(File m) {

        ArrayList<String>cmdLine = new ArrayList<>();
        
        switch(Platform.getPlatform())
        {
            case mac:
            	cmdLine.add("open");

                if (!m.isDirectory())
                {
                	cmdLine.add("-R");
                }
                break;
            case win:
                cmdLine.add("Explorer ");
                cmdLine.add("/select,");
               
                break;
            case linux:
                cmdLine.add("gnome-open");
                cmdLine.add("PATH");
                break;
        }
        if (cmdLine.isEmpty()) return;
        
        try {
        	cmdLine.add(m.getAbsolutePath());
        	
        	SimpleProcess p = new SimpleProcess(cmdLine);
        	p.run();
        	
        	Results r = p.getResults();
        	


            } catch (Throwable e) {
                e.printStackTrace();
            }
        

    }