diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2011-03-07 10:52:19 +0100 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2011-03-07 10:29:09 -0500 |
commit | c825253e74027f87b900c0b811ae019d767c0848 (patch) | |
tree | 3d8b06f6e2949e5cdaa04cf702e250da4d151c86 | |
parent | 41f17cd16fdbd881f372620ed9861483fc46eca0 (diff) | |
download | sssd-c825253e74027f87b900c0b811ae019d767c0848.tar.gz sssd-c825253e74027f87b900c0b811ae019d767c0848.tar.xz sssd-c825253e74027f87b900c0b811ae019d767c0848.zip |
Prevent segfault in failover code
-rw-r--r-- | src/providers/fail_over.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/providers/fail_over.c b/src/providers/fail_over.c index a09a409d4..37ffe268f 100644 --- a/src/providers/fail_over.c +++ b/src/providers/fail_over.c @@ -312,7 +312,7 @@ get_server_status(struct fo_server *server) time_t timeout; if (server->common == NULL) - return SERVER_NAME_RESOLVED; + return SERVER_NAME_NOT_RESOLVED; DEBUG(7, ("Status of server '%s' is '%s'\n", SERVER_NAME(server), str_server_status(server->common->server_status))); @@ -353,7 +353,8 @@ get_port_status(struct fo_server *server) server->port_status = PORT_NEUTRAL; server->last_status_change.tv_sec = tv.tv_sec; - if (STATUS_DIFF(server->common, tv) > HOSTNAME_RESOLVE_TIMEOUT) { + if (server->common != NULL && + STATUS_DIFF(server->common, tv) > HOSTNAME_RESOLVE_TIMEOUT) { DEBUG(4, ("Reseting the server status of '%s'\n", SERVER_NAME(server))); fo_set_server_status(server, SERVER_NAME_NOT_RESOLVED); |