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).