#vulnerable code 
                             public File saveAs(String path) throws IOException, InterruptedException {
		Runtime rt = Runtime.getRuntime();
        String command = this.commandWithParameters() + Symbol.separator + path;
        Process proc = rt.exec(command);
        if(htmlFromString) {
            OutputStream stdin = proc.getOutputStream();
            stdin.write(htmlInput.getBytes());
            stdin.close();
        }

		proc.waitFor();
        if(proc.exitValue() != 0) {
            throw new RuntimeException("Process (" + command + ") exited with status code " + proc.exitValue());
        }

		return new File(path);
	} 
                            #location 13 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                             public File saveAs(String path) throws IOException, InterruptedException {
        byte[] pdf = this.getPDF();
        File file = new File(path);

        BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(new FileOutputStream(file));
        bufferedOutputStream.write(pdf);
        bufferedOutputStream.flush();
        bufferedOutputStream.close();

        return file;
	}