From fcecd2ae67c315a900c374dec2cad3401b3f8bb5 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sat, 28 Feb 2009 02:22:11 -0500 Subject: Fix confdb issues. Avoid uninitialized memory messages in valgrind (in _btreemap_get_keys). Do not free memory we just stored in the btree (in confdb_get_domains_list). Streamline confdb_get_domains() and remove extra calls when we already have all the information handy. Do not store basedn in domain info, the base dn is always calculated out of the domain name. Remove the "provider" attribute, it was really used only to distinguish between LOCAL and other domains, directly check for LOCAL as a special case instead. --- server/util/btreemap.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'server/util/btreemap.c') diff --git a/server/util/btreemap.c b/server/util/btreemap.c index 7bda0570..2d9b1761 100644 --- a/server/util/btreemap.c +++ b/server/util/btreemap.c @@ -166,19 +166,13 @@ int btreemap_set_value(TALLOC_CTX *mem_ctx, return EOK; } -static int _btreemap_get_keys(TALLOC_CTX *mem_ctx, struct btreemap *map, const void ***array, int *count, int depth) +static int _btreemap_get_keys(TALLOC_CTX *mem_ctx, struct btreemap *map, + const void ***array, int *count, int depth) { int ret; const void **tmp_array; - if (map == NULL) { - if (depth == 0) { - /* This is the top-level */ - count = 0; - *array = NULL; - } - return EOK; - } + if (map == NULL) return EOK; /* Left Node */ ret = _btreemap_get_keys(mem_ctx, map->left, array, count, depth+1); @@ -212,5 +206,6 @@ static int _btreemap_get_keys(TALLOC_CTX *mem_ctx, struct btreemap *map, const v int btreemap_get_keys(TALLOC_CTX *mem_ctx, struct btreemap *map, const void ***array, int *count) { *array = NULL; + *count = 0; return _btreemap_get_keys(mem_ctx, map, array, count, 0); } -- cgit