diff options
Diffstat (limited to 'src/libserver/cfg_utils.c')
-rw-r--r-- | src/libserver/cfg_utils.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c index 234f639d4..983a73f3f 100644 --- a/src/libserver/cfg_utils.c +++ b/src/libserver/cfg_utils.c @@ -113,7 +113,9 @@ rspamd_parse_bind_line (struct rspamd_config *cfg, cnf->is_systemd = TRUE; cnf->cnt = strtoul (tokens[1], &err, 10); cnf->addrs = NULL; + if (err == NULL || *err == '\0') { + cnf->name = rspamd_mempool_strdup (cfg->cfg_pool, str); LL_PREPEND (cf->bind_conf, cnf); } else { @@ -123,11 +125,12 @@ rspamd_parse_bind_line (struct rspamd_config *cfg, } else { if (!rspamd_parse_host_port_priority_strv (tokens, &cnf->addrs, - &cnf->cnt, NULL, &cnf->name, DEFAULT_BIND_PORT, cfg->cfg_pool)) { + NULL, &cnf->name, DEFAULT_BIND_PORT, cfg->cfg_pool)) { msg_err ("cannot parse bind line: %s", str); ret = FALSE; } else { + cnf->cnt = cnf->addrs->len; LL_PREPEND (cf->bind_conf, cnf); } } |