Author: mkhl
Date: 2006-07-15 09:27:07 +0000 (Sat, 15 Jul 2006)
New Revision: 17057

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=17057

Log:
When failing before the async handle was set in the up request, free
the complete async handle.

Martin

Modified:
   branches/SOC/mkhl/ldb-map/modules/ldb_map.c


Changeset:
Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c
===================================================================
--- branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 09:22:24 UTC (rev 
17056)
+++ branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 09:27:07 UTC (rev 
17057)
@@ -2140,7 +2140,7 @@
        ac->local_req = talloc(ac, struct ldb_request);
        if (ac->local_req == NULL) {
                map_oom(module);
-               return LDB_ERR_OPERATIONS_ERROR;
+               goto failed;
        }
 
        *(ac->local_req) = *req; /* copy the request */
@@ -2151,9 +2151,8 @@
        /* prepare the remote operation */
        ac->remote_req = talloc(ac, struct ldb_request);
        if (ac->remote_req == NULL) {
-               talloc_free(ac->local_req);
                map_oom(module);
-               return LDB_ERR_OPERATIONS_ERROR;
+               goto failed;
        }
 
        *(ac->remote_req) = *req; /* copy the request */
@@ -2201,8 +2200,7 @@
        return ldb_next_remote_request(module, ac->remote_req);
 
 failed:
-       talloc_free(ac->local_req);
-       talloc_free(ac->remote_req);
+       talloc_free(h);
        return LDB_ERR_OPERATIONS_ERROR;
 }
 
@@ -2303,7 +2301,7 @@
        ac->local_req = talloc(ac, struct ldb_request);
        if (ac->local_req == NULL) {
                map_oom(module);
-               return LDB_ERR_OPERATIONS_ERROR;
+               goto failed;
        }
 
        *(ac->local_req) = *req; /* copy the request */
@@ -2314,9 +2312,8 @@
        /* prepare the remote operation */
        ac->remote_req = talloc(ac, struct ldb_request);
        if (ac->remote_req == NULL) {
-               talloc_free(ac->local_req);
                map_oom(module);
-               return LDB_ERR_OPERATIONS_ERROR;
+               goto failed;
        }
 
        *(ac->remote_req) = *req; /* copy the request */
@@ -2361,8 +2358,7 @@
        return ldb_next_request(module, ac->search_req);
 
 failed:
-       talloc_free(ac->local_req);
-       talloc_free(ac->remote_req);
+       talloc_free(h);
        return LDB_ERR_OPERATIONS_ERROR;
 }
 

Reply via email to