summaryrefslogtreecommitdiff
path: root/source3/lib/ldb/modules
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-11-13 10:43:12 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:15:47 -0500
commit82cd90292fea984f6a1ef335bd86c1b4c6d6c684 (patch)
tree90b224783a61f9fcf8603622da72eff909c1e645 /source3/lib/ldb/modules
parentbae1fcd20fb01942b40fddf7893d54063cf5ac95 (diff)
downloadsamba-82cd90292fea984f6a1ef335bd86c1b4c6d6c684.tar.gz
samba-82cd90292fea984f6a1ef335bd86c1b4c6d6c684.tar.bz2
samba-82cd90292fea984f6a1ef335bd86c1b4c6d6c684.zip
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)
Diffstat (limited to 'source3/lib/ldb/modules')
-rw-r--r--source3/lib/ldb/modules/schema.c12
1 files 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",