#fixed code
                             public static ArrayList<String> runNative(String cmdToRun) {
		Process p = null;
		try {
			p = Runtime.getRuntime().exec(cmdToRun);
			p.waitFor();
		} catch (IOException e) {
			return null;
		} catch (InterruptedException e) {
			e.printStackTrace();
		}

		BufferedReader reader = new BufferedReader(new InputStreamReader(
				p.getInputStream()));
		String line = "";
		ArrayList<String> sa = new ArrayList<String>();
		try {
			while ((line = reader.readLine()) != null) {
				sa.add(line);
			}
		} catch (IOException e) {
			return null;
		}
		return sa;
	}
#vulnerable code 
                             public static ArrayList<String> runNative(String cmdToRun) {
		Process p = null;
		try {
			p = Runtime.getRuntime().exec(cmdToRun);
			//p.waitFor();
		} catch (IOException e) {
			return null;
		}

		BufferedReader reader = new BufferedReader(new InputStreamReader(
				p.getInputStream()));
		String line = "";
		ArrayList<String> sa = new ArrayList<String>();
		try {
			while ((line = reader.readLine()) != null) {
				sa.add(line);
			}
		} catch (IOException e) {
			return null;
		}
		p.destroy();
		return sa;
	} 
                            #location 6 
                            #vulnerability type RESOURCE_LEAK