summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-11-29 12:34:03 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:46:51 -0500
commit6eabad9c9d977c1c5c6ecf7494a0be42ad113d23 (patch)
tree96a9cf1b04fb6fe460f734cc53df409c65daa7a0 /source4/dsdb/samdb/ldb_modules
parentb77685a4ae40e6619d82af98e0def173b4f4b7ec (diff)
downloadsamba-6eabad9c9d977c1c5c6ecf7494a0be42ad113d23.tar.gz
samba-6eabad9c9d977c1c5c6ecf7494a0be42ad113d23.tar.bz2
samba-6eabad9c9d977c1c5c6ecf7494a0be42ad113d23.zip
r11958: - fixed memory leaks in the ldb_result handling in ldb operations
- removed an unnecessary level of pointer in ldb_search structure (This used to be commit b8d4afb14a18dfd8bac79882a035e74d3ed312bd)
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules')
-rw-r--r--source4/dsdb/samdb/ldb_modules/proxy.c6
-rw-r--r--source4/dsdb/samdb/ldb_modules/rootdse.c9
2 files changed, 7 insertions, 8 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/proxy.c b/source4/dsdb/samdb/ldb_modules/proxy.c
index 643ff5f3d0..a567db689d 100644
--- a/source4/dsdb/samdb/ldb_modules/proxy.c
+++ b/source4/dsdb/samdb/ldb_modules/proxy.c
@@ -295,14 +295,14 @@ static int proxy_search_bytree(struct ldb_module *module, struct ldb_request *re
return -1;
}
- for (i = 0; i < (*newreq.op.search.res)->count; i++) {
+ for (i = 0; i < newreq.op.search.res->count; i++) {
struct ldb_ldif ldif;
printf("# record %d\n", i+1);
- proxy_convert_record(module, (*newreq.op.search.res)->msgs[i]);
+ proxy_convert_record(module, newreq.op.search.res->msgs[i]);
ldif.changetype = LDB_CHANGETYPE_NONE;
- ldif.msg = (*newreq.op.search.res)->msgs[i];
+ ldif.msg = newreq.op.search.res->msgs[i];
}
return ret;
diff --git a/source4/dsdb/samdb/ldb_modules/rootdse.c b/source4/dsdb/samdb/ldb_modules/rootdse.c
index df12011d89..4032aee8b2 100644
--- a/source4/dsdb/samdb/ldb_modules/rootdse.c
+++ b/source4/dsdb/samdb/ldb_modules/rootdse.c
@@ -46,11 +46,11 @@ static int rootdse_add_dynamic(struct ldb_module *module, struct ldb_request *re
/* this is gross, and will be removed when I change ldb_result not
to be so pointer crazy :-) */
- if (s->res[0][0].msgs == NULL) {
+ if (s->res->msgs == NULL) {
return LDB_SUCCESS;
}
- msg = s->res[0][0].msgs[0];
+ msg = s->res->msgs[0];
msg->dn = ldb_dn_explode(msg, "");
@@ -74,8 +74,7 @@ failed:
*/
static int rootdse_search_bytree(struct ldb_module *module, struct ldb_request *req)
{
- struct ldb_request r = *req;
- struct ldb_search *s = &r.op.search;
+ struct ldb_search *s = &req->op.search;
int ret;
TALLOC_CTX *tmp_ctx;
@@ -97,7 +96,7 @@ static int rootdse_search_bytree(struct ldb_module *module, struct ldb_request *
}
/* grab the static contents of the record */
- ret = ldb_next_request(module, &r);
+ ret = ldb_next_request(module, req);
req->op.search.res = s->res;