#vulnerable code 
                                public RepositoryChanged checkoutSvnRepository(String repoName, String repoRemoteLocation, String repoUserName, String repoPassword, String repoLocations, boolean useCredentials) {
        boolean successful = false;
        Singleton.getLogger().info("Attempting to checkout " + repoRemoteLocation);

        ProcessBuilder processBuilder;

        // http://serverfault.com/questions/158349/how-to-stop-subversion-from-prompting-about-server-certificate-verification-fai
        // http://stackoverflow.com/questions/34687/subversion-ignoring-password-and-username-options#38386
        if (useCredentials) {
            processBuilder = new ProcessBuilder(this.SVNBINARYPATH, "checkout", "--no-auth-cache", "--non-interactive", repoRemoteLocation, repoName);
        }
        else {
            processBuilder = new ProcessBuilder(this.SVNBINARYPATH, "checkout", "--no-auth-cache", "--non-interactive", "--username", repoUserName, "--password", repoPassword, repoRemoteLocation, repoName);
        }

        processBuilder.directory(new File(repoLocations));

        Process process = null;

        try {
            File f = new File(repoLocations);
            if (!f.exists()) {
                f.mkdir();
            }

            process = processBuilder.start();

            InputStream is = process.getInputStream();
            InputStreamReader isr = new InputStreamReader(is);
            BufferedReader br = new BufferedReader(isr);
            String line;

            while ((line = br.readLine()) != null) {
                Singleton.getLogger().info(line);
            }

            successful = true;

        } catch (IOException ex) {
            Singleton.getLogger().warning("ERROR - caught a " + ex.getClass() + " in " + this.getClass() + " checkoutSvnRepository for " + repoName + "\n with message: " + ex.getMessage());
        }
        finally {
            Helpers.closeQuietly(process);
        }

        RepositoryChanged repositoryChanged = new RepositoryChanged(successful);
        repositoryChanged.setClone(true);

        return repositoryChanged;
    } 
                            #location 39 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                public RepositoryChanged checkoutSvnRepository(String repoName, String repoRemoteLocation, String repoUserName, String repoPassword, String repoLocations, boolean useCredentials) {
        boolean successful = false;
        Singleton.getLogger().info("Attempting to checkout " + repoRemoteLocation);

        ProcessBuilder processBuilder;

        // http://serverfault.com/questions/158349/how-to-stop-subversion-from-prompting-about-server-certificate-verification-fai
        // http://stackoverflow.com/questions/34687/subversion-ignoring-password-and-username-options#38386
        if (useCredentials) {
            processBuilder = new ProcessBuilder(this.SVNBINARYPATH, "checkout", "--no-auth-cache", "--non-interactive", repoRemoteLocation, repoName);
        }
        else {
            processBuilder = new ProcessBuilder(this.SVNBINARYPATH, "checkout", "--no-auth-cache", "--non-interactive", "--username", repoUserName, "--password", repoPassword, repoRemoteLocation, repoName);
        }

        processBuilder.directory(new File(repoLocations));

        Process process = null;
        BufferedReader bufferedReader = null;

        try {
            File file = new File(repoLocations);
            if (!file.exists()) {
                boolean success = file.mkdir();
                if (!success) {
                    throw new IOException("Was unable to create directory " + repoLocations);
                }
            }

            process = processBuilder.start();

            InputStream is = process.getInputStream();
            InputStreamReader isr = new InputStreamReader(is);
            bufferedReader = new BufferedReader(isr);
            String line;

            while ((line = bufferedReader.readLine()) != null) {
                Singleton.getLogger().info(line);
            }

            successful = true;

        } catch (IOException ex) {
            Singleton.getLogger().warning("ERROR - caught a " + ex.getClass() + " in " + this.getClass() + " checkoutSvnRepository for " + repoName + "\n with message: " + ex.getMessage());
        }
        finally {
            Helpers.closeQuietly(process);
            Helpers.closeQuietly(bufferedReader);
        }

        RepositoryChanged repositoryChanged = new RepositoryChanged(successful);
        repositoryChanged.setClone(true);

        return repositoryChanged;
    }