]> git.samba.org - abartlet/samba.git/.git/commitdiff
Be less aggressive with talloc_free() - avoid memory corruption
authorAndrew Bartlett <abartlet@samba.org>
Tue, 2 Dec 2008 05:25:38 +0000 (16:25 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 2 Dec 2008 05:25:38 +0000 (16:25 +1100)
It seems the talloc tree in ldb is very complex - better to just let
it be cleaned up by the caller when they are done with the whole
thing.

Andrew Bartlett

source4/dsdb/samdb/ldb_modules/extended_dn_in.c
source4/dsdb/samdb/ldb_modules/extended_dn_store.c

index 928cf387f4fbd76566a2f821435a90b141e61bf6..f21c171b7bc338ad06b3465267ac0222d92f8115 100644 (file)
@@ -54,8 +54,6 @@ static int extended_final_callback(struct ldb_request *req, struct ldb_reply *ar
        if (ares->error != LDB_SUCCESS) {
                ret = ldb_module_done(ac->req, ares->controls,
                                      ares->response, ares->error);
-               talloc_steal(ac->req, ares);
-               talloc_free(ac);
        } else {
                switch (ares->type) {
                case LDB_REPLY_ENTRY:
@@ -70,8 +68,6 @@ static int extended_final_callback(struct ldb_request *req, struct ldb_reply *ar
                        
                        ret = ldb_module_done(ac->req, ares->controls,
                                              ares->response, ares->error);
-                       talloc_steal(ac->req, ares);
-                       talloc_free(ac);
                        break;
                }
        }
index 9ae9f6953b80330475a06836ac004d608efcc55d..b39a1379c7472f87fb440d68c4c962d31b52f491 100644 (file)
@@ -95,8 +95,6 @@ static int extended_final_callback(struct ldb_request *req, struct ldb_reply *ar
        if (ares->error != LDB_SUCCESS) {
                ret = ldb_module_done(ac->req, ares->controls,
                                      ares->response, ares->error);
-               talloc_steal(ac->req, ares);
-               talloc_free(ac);
        } else {
                switch (ares->type) {
                case LDB_REPLY_ENTRY:
@@ -111,8 +109,6 @@ static int extended_final_callback(struct ldb_request *req, struct ldb_reply *ar
                        
                        ret = ldb_module_done(ac->req, ares->controls,
                                              ares->response, ares->error);
-                       talloc_steal(ac->req, ares);
-                       talloc_free(ac);
                        break;
                }
        }