summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2011-03-07 10:52:19 +0100
committerStephen Gallagher <sgallagh@redhat.com>2011-03-07 10:29:09 -0500
commitc825253e74027f87b900c0b811ae019d767c0848 (patch)
tree3d8b06f6e2949e5cdaa04cf702e250da4d151c86 /src
parent41f17cd16fdbd881f372620ed9861483fc46eca0 (diff)
downloadsssd-c825253e74027f87b900c0b811ae019d767c0848.tar.gz
sssd-c825253e74027f87b900c0b811ae019d767c0848.tar.bz2
sssd-c825253e74027f87b900c0b811ae019d767c0848.zip
Prevent segfault in failover code
Diffstat (limited to 'src')
-rw-r--r--src/providers/fail_over.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/providers/fail_over.c b/src/providers/fail_over.c
index a09a409d..37ffe268 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);