upstream: Fix case of empty string domain.

Found by compiler note.

Signed-off-by: Michael Adam <obnox@samba.org>
This commit is contained in:
Michael Adam 2017-11-16 01:53:21 +01:00
parent 8d0ea71486
commit badb6435d6

View File

@ -124,7 +124,7 @@ static struct upstream *upstream_build (const char *host, int port, const char *
log_message (LOG_INFO, "Added no-upstream for %s", domain); log_message (LOG_INFO, "Added no-upstream for %s", domain);
} else { } else {
if (!host || host[0] == '\0' || port < 1 || !domain if (!host || host[0] == '\0' || port < 1 || !domain
|| domain == '\0') { || domain[0] == '\0') {
log_message (LOG_WARNING, log_message (LOG_WARNING,
"Nonsense upstream rule: invalid parameters"); "Nonsense upstream rule: invalid parameters");
goto fail; goto fail;