summaryrefslogtreecommitdiffstats
path: root/src/db/sysdb_subdomains.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/db/sysdb_subdomains.c')
-rw-r--r--src/db/sysdb_subdomains.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/db/sysdb_subdomains.c b/src/db/sysdb_subdomains.c
index 96b8b4b21..b3998a2db 100644
--- a/src/db/sysdb_subdomains.c
+++ b/src/db/sysdb_subdomains.c
@@ -59,7 +59,7 @@ errno_t sysdb_get_subdomains(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb,
goto done;
}
- list = talloc_zero_array(tmp_ctx, struct sysdb_subdom *, res->count);
+ list = talloc_zero_array(tmp_ctx, struct sysdb_subdom *, res->count + 1);
if (list == NULL) {
ret = ENOMEM;
goto done;
@@ -117,6 +117,8 @@ errno_t sysdb_get_subdomains(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb,
}
}
+ list[res->count] = NULL;
+
*subdomain_count = res->count;
*subdomain_list = talloc_steal(mem_ctx, list);
ret = EOK;