summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/util/domain_info_utils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/domain_info_utils.c b/src/util/domain_info_utils.c
index 039d66f8..34aa3f33 100644
--- a/src/util/domain_info_utils.c
+++ b/src/util/domain_info_utils.c
@@ -36,9 +36,9 @@ struct sss_domain_info *get_next_domain(struct sss_domain_info *domain,
} else if (descend && IS_SUBDOMAIN(dom) && dom->parent->next) {
dom = dom->parent->next;
} else {
- return NULL;
+ dom = NULL;
}
- if (!dom->disabled) break;
+ if (dom && !dom->disabled) break;
}
return dom;