summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Zeleny <jzeleny@redhat.com>2012-04-24 13:25:18 -0400
committerStephen Gallagher <sgallagh@redhat.com>2012-04-24 14:26:52 -0400
commit2c68b4a680e64d8e506794d5976367394133504b (patch)
tree51cdaac11d9f61b4f1dba3ebedd1fec2ebca1fe7 /src
parent53dae47b4e8995be624c74cb2d4838c6856b0ba4 (diff)
downloadsssd-2c68b4a680e64d8e506794d5976367394133504b.tar.gz
sssd-2c68b4a680e64d8e506794d5976367394133504b.tar.xz
sssd-2c68b4a680e64d8e506794d5976367394133504b.zip
Two fixes in responder subdomain code
Diffstat (limited to 'src')
-rw-r--r--src/responder/common/responder_get_domains.c6
-rw-r--r--src/util/domain_info_utils.c2
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 702593f67..6b92bbe2c 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 d8de790d9..d9f320d80 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);
}