1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

r19324: fixed a leak on deleting records when no index is in place

This commit is contained in:
Andrew Tridgell 2006-10-16 10:12:43 +00:00 committed by Gerald (Jerry) Carter
parent 06387e1cf2
commit 0824b3b8c1

View File

@ -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);