#vulnerable code 
                                public void stopRecording() throws IOException {
        Integer processId = androidScreenRecordProcess.get(Thread.currentThread().getId());
        if (processId != -1) {
            String process = "pgrep -P " + processId;
            System.out.println(process);
            Process p2 = Runtime.getRuntime().exec(process);
            BufferedReader r = new BufferedReader(new InputStreamReader(p2.getInputStream()));
            String command = "kill -s SIGTSTP " + processId;
            System.out.println("Stopping Video Recording");
            System.out.println("******************" + command);
            Process killProcess = Runtime.getRuntime().exec(command);
            try {
                killProcess.waitFor();
                Thread.sleep(5000);
                System.out.println(
                    "Killed video recording with exit code :" + killProcess.exitValue()
                        + processId);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    } 
                            #location 16 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                public void stopRecording() throws IOException {
        Integer processId = androidScreenRecordProcess.get(Thread.currentThread().getId());
        if (processId != -1) {
            String process = "pgrep -P " + processId;
            System.out.println(process);
            Process p2 = Runtime.getRuntime().exec(process);
            BufferedReader r = new BufferedReader(new InputStreamReader(p2.getInputStream()));
            String command = "kill " + processId;
            System.out.println("Stopping Video Recording");
            System.out.println("******************" + command);
            try {
                runCommandThruProcess(command);
                Thread.sleep(10000);
                System.out.println("Killed video recording with exit code :" + command);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }