return ret;
}
- talloc_free(ares);
+ ac->remote_done_ares = talloc_steal(ac, ares);
ret = map_search_local(ac);
if (ret != LDB_SUCCESS) {
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 */
/* 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;
struct map_reply *r_list;
struct map_reply *r_current;
+
+ /* The response continaing any controls the remote server gave */
+ struct ldb_reply *remote_done_ares;
};
/* Common operations