summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-10-16 10:12:43 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:21:09 -0500
commit91c33d44b61ee775534ab723e20e6ea4070309b7 (patch)
tree409582a64dd034d9e2ad79f2f1c5d8b3fe8dd9ac /source4
parent888458d434b24ad5669a5b3b148059fe05dfcb75 (diff)
downloadsamba-91c33d44b61ee775534ab723e20e6ea4070309b7.tar.gz
samba-91c33d44b61ee775534ab723e20e6ea4070309b7.tar.bz2
samba-91c33d44b61ee775534ab723e20e6ea4070309b7.zip
r19324: fixed a leak on deleting records when no index is in place
(This used to be commit 0824b3b8c1003064b0f2c5a3f084f3e711155e8c)
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_index.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_index.c b/source4/lib/ldb/ldb_tdb/ldb_index.c
index 8a9a82a98c..0c9d1f33a1 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_index.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_index.c
@@ -1030,6 +1030,12 @@ int ltdb_index_del(struct ldb_module *module, const struct ldb_message *msg)
char *dn;
unsigned int i, j;
+ /* find the list of indexed fields */
+ if (ltdb->cache->indexlist->num_elements == 0) {
+ /* no indexed fields */
+ return 0;
+ }
+
if (ldb_dn_is_special(msg->dn)) {
return 0;
}
@@ -1039,12 +1045,6 @@ int ltdb_index_del(struct ldb_module *module, const struct ldb_message *msg)
return -1;
}
- /* find the list of indexed fields */
- if (ltdb->cache->indexlist->num_elements == 0) {
- /* no indexed fields */
- return 0;
- }
-
for (i = 0; i < msg->num_elements; i++) {
ret = ldb_msg_find_idx(ltdb->cache->indexlist, msg->elements[i].name,
NULL, LTDB_IDXATTR);