X-Git-Url: http://git.samba.org/samba.git/?p=ira%2Fwip.git;a=blobdiff_plain;f=source4%2Flib%2Fldb%2Fldb_map%2Fldb_map_outbound.c;h=45caffeeae028e9b1c55818ec59c4284f063eb8f;hp=6a8e796ca4646d0b5d93c340e07df3a16779c46a;hb=fa2e04b64004f24bcac51a44ce37b8923480b819;hpb=96ec45309a367a00234f7c62c2d30c64ae95b680 diff --git a/source4/lib/ldb/ldb_map/ldb_map_outbound.c b/source4/lib/ldb/ldb_map/ldb_map_outbound.c index 6a8e796ca46..45caffeeae0 100644 --- a/source4/lib/ldb/ldb_map/ldb_map_outbound.c +++ b/source4/lib/ldb/ldb_map/ldb_map_outbound.c @@ -1261,7 +1261,7 @@ static int map_remote_search_callback(struct ldb_request *req, return ret; } - talloc_free(ares); + ac->remote_done_ares = talloc_steal(ac, ares); ret = map_search_local(ac); if (ret != LDB_SUCCESS) { @@ -1333,6 +1333,7 @@ int map_local_merge_callback(struct ldb_request *req, struct ldb_reply *ares) break; case LDB_REPLY_DONE: + /* We don't need the local 'ares', but we will use the remote one from below */ talloc_free(ares); /* No local record found, map and send remote record */ @@ -1371,9 +1372,9 @@ int map_local_merge_callback(struct ldb_request *req, struct ldb_reply *ares) /* ok we are done with all search, finally it is time to * finish operations for this module */ return ldb_module_done(ac->req, - ac->r_current->remote->controls, - ac->r_current->remote->response, - ac->r_current->remote->error); + ac->remote_done_ares->controls, + ac->remote_done_ares->response, + ac->remote_done_ares->error); } return LDB_SUCCESS;