if ((pos = strcspn(p, "\t ")) == 0) {
error("%s: line %d: bogus format: %s", filename, line, p);
+ fclose(configfd);
return (-1);
}
if (option->status != ST_UNDEF) {
error("%s: line %d: duplicate option line: %s", filename, line, p);
+ fclose(configfd);
return (-1);
}
switch (option->type) {
case OT_STR:
- if (set_option_str(filename, line, option, p) < 0)
+ if (set_option_str(filename, line, option, p) < 0) {
+ fclose(configfd);
return (-1);
+ }
break;
case OT_INT:
- if (set_option_int(filename, line, option, p) < 0)
+ if (set_option_int(filename, line, option, p) < 0) {
+ fclose(configfd);
return (-1);
+ }
break;
case OT_SRV:
- if (set_option_srv(filename, line, option, p) < 0)
+ if (set_option_srv(filename, line, option, p) < 0) {
+ fclose(configfd);
return (-1);
+ }
break;
case OT_AUO:
- if (set_option_auo(filename, line, option, p) < 0)
+ if (set_option_auo(filename, line, option, p) < 0) {
+ fclose(configfd);
return (-1);
+ }
break;
default:
fatal("rc_read_config: impossible case branch!");
option = find_option(optname, OT_STR);
if (option == NULL)
- fatal("rc_conf_str: unkown config option requested: %s", optname);
+ fatal("rc_conf_str: unknown config option requested: %s", optname);
return (char *)option->val;
}
option = find_option(optname, OT_INT|OT_AUO);
if (option == NULL)
- fatal("rc_conf_int: unkown config option requested: %s", optname);
+ fatal("rc_conf_int: unknown config option requested: %s", optname);
return *((int *)option->val);
}
option = find_option(optname, OT_SRV);
if (option == NULL)
- fatal("rc_conf_srv: unkown config option requested: %s", optname);
+ fatal("rc_conf_srv: unknown config option requested: %s", optname);
return (SERVER *)option->val;
}
if (result == 0)
{
memset (buffer, '\0', sizeof (buffer));
- memset (secret, '\0', sizeof (secret));
error("rc_find_server: couldn't find RADIUS server %s in %s",
server_name, rc_conf_str("servers"));
return (-1);