diff options
author | Andrew Tridgell <tridge@samba.org> | 2006-10-21 00:10:19 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:15:35 -0500 |
commit | 7a390a0dabcdadb30196662b6cdec512bf81dcb4 (patch) | |
tree | 8ed126e072e4446ad47d25f277059af5ccd556cc /source3/lib/ldb/modules | |
parent | aa3ca346d82da2501406cc1f482643b20905e467 (diff) | |
download | samba-7a390a0dabcdadb30196662b6cdec512bf81dcb4.tar.gz samba-7a390a0dabcdadb30196662b6cdec512bf81dcb4.tar.bz2 samba-7a390a0dabcdadb30196662b6cdec512bf81dcb4.zip |
r19430: merge recent ldb changes from Samba4. This includes memory leak fixes
and significant speedups
(This used to be commit bb5c205fef90aa8b89ba400fb9f2f37a111676a8)
Diffstat (limited to 'source3/lib/ldb/modules')
-rw-r--r-- | source3/lib/ldb/modules/ldb_map.c | 2 | ||||
-rw-r--r-- | source3/lib/ldb/modules/ldb_map_outbound.c | 11 | ||||
-rw-r--r-- | source3/lib/ldb/modules/objectclass.c | 2 |
3 files changed, 13 insertions, 2 deletions
diff --git a/source3/lib/ldb/modules/ldb_map.c b/source3/lib/ldb/modules/ldb_map.c index 0c58687ddb..f9ae66a2aa 100644 --- a/source3/lib/ldb/modules/ldb_map.c +++ b/source3/lib/ldb/modules/ldb_map.c @@ -1233,11 +1233,13 @@ static int map_init_dns(struct ldb_module *module, struct ldb_map_context *data, if (res->count == 0) { ldb_debug(module->ldb, LDB_DEBUG_ERROR, "ldb_map: " "No results for '%s=%s'!\n", MAP_DN_NAME, name); + talloc_free(res); return LDB_ERR_CONSTRAINT_VIOLATION; } if (res->count > 1) { ldb_debug(module->ldb, LDB_DEBUG_ERROR, "ldb_map: " "Too many results for '%s=%s'!\n", MAP_DN_NAME, name); + talloc_free(res); return LDB_ERR_CONSTRAINT_VIOLATION; } diff --git a/source3/lib/ldb/modules/ldb_map_outbound.c b/source3/lib/ldb/modules/ldb_map_outbound.c index e1b207f6eb..cd33f29043 100644 --- a/source3/lib/ldb/modules/ldb_map_outbound.c +++ b/source3/lib/ldb/modules/ldb_map_outbound.c @@ -202,7 +202,16 @@ static int ldb_msg_replace(struct ldb_message *msg, const struct ldb_message_ele } } - *old = *el; /* copy new element */ + /* copy new element */ + *old = *el; + + /* and make sure we reference the contents */ + if (!talloc_reference(msg->elements, el->name)) { + return -1; + } + if (!talloc_reference(msg->elements, el->values)) { + return -1; + } return 0; } diff --git a/source3/lib/ldb/modules/objectclass.c b/source3/lib/ldb/modules/objectclass.c index 493ecdaad4..e4040a8e3d 100644 --- a/source3/lib/ldb/modules/objectclass.c +++ b/source3/lib/ldb/modules/objectclass.c @@ -464,7 +464,7 @@ static int objectclass_search_self(struct ldb_handle *h) { ac->search_req->operation = LDB_SEARCH; ac->search_req->op.search.base = ac->orig_req->op.mod.message->dn; ac->search_req->op.search.scope = LDB_SCOPE_BASE; - ac->search_req->op.search.tree = ldb_parse_tree(ac->module->ldb, NULL); + ac->search_req->op.search.tree = ldb_parse_tree(ac->search_req, NULL); if (ac->search_req->op.search.tree == NULL) { ldb_set_errstring(ac->module->ldb, "objectclass: Internal error producing null search"); return LDB_ERR_OPERATIONS_ERROR; |