diff options
-rw-r--r-- | src/responder/common/responder_get_domains.c | 6 | ||||
-rw-r--r-- | src/util/domain_info_utils.c | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/responder/common/responder_get_domains.c b/src/responder/common/responder_get_domains.c index 702593f6..6b92bbe2 100644 --- a/src/responder/common/responder_get_domains.c +++ b/src/responder/common/responder_get_domains.c @@ -244,6 +244,12 @@ static errno_t get_domains_done(struct tevent_req *req) goto done; } + if (subdomain_count == 0) { + talloc_zfree(domain->subdomains); + domain->subdomain_count = 0; + goto done; + } + new_sd_list = talloc_zero_array(domain, struct sss_domain_info *, subdomain_count); if (new_sd_list == NULL) { diff --git a/src/util/domain_info_utils.c b/src/util/domain_info_utils.c index d8de790d..d9f320d8 100644 --- a/src/util/domain_info_utils.c +++ b/src/util/domain_info_utils.c @@ -107,6 +107,6 @@ fail: struct sss_domain_info *copy_subdomain(TALLOC_CTX *mem_ctx, struct sss_domain_info *subdomain) { - return new_subdomain(mem_ctx, subdomain, subdomain->name, + return new_subdomain(mem_ctx, subdomain->parent, subdomain->name, subdomain->flat_name, subdomain->domain_id); } |