Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Trac Trac
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Service Desk
    • Milestones
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • Legacy
  • TracTrac
  • Issues
  • #20692

Closed (moved)
(moved)
Open
Created Nov 17, 2016 by Roger Dingledine@arma

risky duplicate code in rend_config_services()

In rend_config_services(), we have a loop over options->RendConfigLines, and one of the things it does is:

      if (service) { /* register the one we just finished parsing */
        if (rend_service_check_private_dir(options, service, 0) < 0) {
          rend_service_free(service);
          return -1;
        }

        if (validate_only)
          rend_service_free(service);
        else
          rend_add_service(service);
      }

Then once the loop is finished, it proceeds to call

  if (service) {
    if (rend_service_check_private_dir(options, service, 0) < 0) {
      rend_service_free(service);
      return -1;
    }

    if (validate_only) {
      rend_service_free(service);
    } else {
      rend_add_service(service);
    }
  }

Look familiar? This duplication is going to bite us when somebody changes one part but not the other.

Found while looking at #20638 (moved).

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking