diff options
author | Stefan Metzmacher <metze@samba.org> | 2006-12-12 18:14:31 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:29:10 -0500 |
commit | 2986313a68355069ee26b2a2527459e737d3bc29 (patch) | |
tree | efa902d7b215b7d2f18c4ad2e4e23478a5098c42 /source4 | |
parent | 21327c43201cfe96d7950bc19be041b924cad82f (diff) | |
download | samba-2986313a68355069ee26b2a2527459e737d3bc29.tar.gz samba-2986313a68355069ee26b2a2527459e737d3bc29.tar.bz2 samba-2986313a68355069ee26b2a2527459e737d3bc29.zip |
r20125: fix some ugly mem leaks in the ldb_ildb backend
metze
(This used to be commit db85b7840c1022665d410516d9a8989474d67a0f)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/lib/ldb/ldb_ildap/ldb_ildap.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source4/lib/ldb/ldb_ildap/ldb_ildap.c b/source4/lib/ldb/ldb_ildap/ldb_ildap.c index 6028920e55..2e45eef195 100644 --- a/source4/lib/ldb/ldb_ildap/ldb_ildap.c +++ b/source4/lib/ldb/ldb_ildap/ldb_ildap.c @@ -329,7 +329,7 @@ static struct ildb_context *init_ildb_handle(struct ildb_private *ildb, struct ildb_context *ildb_ac; struct ldb_handle *h; - h = talloc_zero(ildb->ldap, struct ldb_handle); + h = talloc_zero(req, struct ldb_handle); if (h == NULL) { ldb_set_errstring(ildb->module->ldb, "Out of Memory"); return NULL; @@ -373,6 +373,7 @@ static int ildb_request_send(struct ildb_private *ildb, struct ldap_message *msg ldb_set_errstring(ildb->module->ldb, "async send request failed"); return LDB_ERR_OPERATIONS_ERROR; } + ildb_ac->req = talloc_steal(ildb_ac, req); if (!req->conn) { ldb_set_errstring(ildb->module->ldb, "connection to remote LDAP server dropped?"); @@ -389,7 +390,6 @@ static int ildb_request_send(struct ildb_private *ildb, struct ldap_message *msg req->async.fn = ildb_callback; req->async.private_data = ildb_ac->handle; - ildb_ac->req = talloc_move(ildb_ac, &req); return LDB_SUCCESS; } @@ -431,7 +431,7 @@ static int ildb_search(struct ldb_module *module, struct ldb_request *req) return LDB_ERR_OPERATIONS_ERROR; } - msg = new_ldap_message(ildb); + msg = new_ldap_message(req); if (msg == NULL) { ldb_set_errstring(module->ldb, "Out of Memory"); return LDB_ERR_OPERATIONS_ERROR; @@ -487,7 +487,7 @@ static int ildb_add(struct ldb_module *module, struct ldb_request *req) return ildb_request_noop(ildb, req); } - msg = new_ldap_message(ildb->ldap); + msg = new_ldap_message(req); if (msg == NULL) { return LDB_ERR_OPERATIONS_ERROR; } @@ -537,7 +537,7 @@ static int ildb_modify(struct ldb_module *module, struct ldb_request *req) return ildb_request_noop(ildb, req); } - msg = new_ldap_message(ildb->ldap); + msg = new_ldap_message(req); if (msg == NULL) { return LDB_ERR_OPERATIONS_ERROR; } @@ -585,7 +585,7 @@ static int ildb_delete(struct ldb_module *module, struct ldb_request *req) return ildb_request_noop(ildb, req); } - msg = new_ldap_message(ildb->ldap); + msg = new_ldap_message(req); if (msg == NULL) { return LDB_ERR_OPERATIONS_ERROR; } @@ -616,7 +616,7 @@ static int ildb_rename(struct ldb_module *module, struct ldb_request *req) return ildb_request_noop(ildb, req); } - msg = new_ldap_message(ildb->ldap); + msg = new_ldap_message(req); if (msg == NULL) { return LDB_ERR_OPERATIONS_ERROR; } |