From 82cd90292fea984f6a1ef335bd86c1b4c6d6c684 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 13 Nov 2006 10:43:12 +0000 Subject: r19688: Fix a deadcode warning by Coverity. Simo, I'm not sure this is the correct fix. So I'd like you to look at it and merge to 4 if appropriate. Volker (This used to be commit afd7f12124b02b594063535f93903a8a598a0587) --- source3/lib/ldb/modules/schema.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/source3/lib/ldb/modules/schema.c b/source3/lib/ldb/modules/schema.c index 556a35060d..221263a869 100644 --- a/source3/lib/ldb/modules/schema.c +++ b/source3/lib/ldb/modules/schema.c @@ -201,12 +201,7 @@ static int get_attr_list_recursive(struct ldb_module *module, struct schema_stru } ret = ldb_search(module->ldb, NULL, LDB_SCOPE_SUBTREE, filter, NULL, &srch); - if (ret != 1) { - return ret; - } - talloc_steal(schema_struct, srch); - - if (ret <= 0) { + if (ret != LDB_SUCCESS) { /* Schema DB Error: Error occurred retrieving Object Class Description */ ldb_debug_set(module->ldb, LDB_DEBUG_ERROR, @@ -214,7 +209,10 @@ static int get_attr_list_recursive(struct ldb_module *module, struct schema_stru schema_struct->objectclasses.attr[i].name); return -1; } - if (ret > 1) { + + talloc_steal(schema_struct, srch); + + if (srch->count > 1) { /* Schema DB Error: Too Many Records */ ldb_debug_set(module->ldb, LDB_DEBUG_ERROR, "Too many records found retrieving Objectclass %s.\n", -- cgit