static int vlv_results(struct vlv_context *ac, struct ldb_reply *ares)
{
+ struct ldb_extended *response = (ares != NULL ? ares->response : NULL);
struct ldb_vlv_resp_control *vlv;
unsigned int num_ctrls;
int ret, i, first_i, last_i;
if (ac->store == NULL) {
ret = LDB_ERR_OPERATIONS_ERROR;
return ldb_module_done(
- ac->req, ac->controls, ares->response, ret);
+ ac->req, ac->controls, response, ret);
}
if (ac->store->first_ref) {
return ldb_module_done(
ac->req,
ac->controls,
- ares->response,
+ response,
ret);
}
} else {
return ldb_module_done(
ac->req,
ac->controls,
- ares->response,
+ response,
ret);
}
}
return ldb_module_done(
ac->req,
ac->controls,
- ares->response,
+ response,
ret);
}
if (ac->controls == NULL) {
ret = LDB_ERR_OPERATIONS_ERROR;
return ldb_module_done(
- ac->req, ac->controls, ares->response, ret);
+ ac->req, ac->controls, response, ret);
}
ac->controls[num_ctrls] = NULL;
if (ac->controls[i] == NULL) {
ret = LDB_ERR_OPERATIONS_ERROR;
return ldb_module_done(
- ac->req, ac->controls, ares->response, ret);
+ ac->req, ac->controls, response, ret);
}
ac->controls[i]->oid = talloc_strdup(ac->controls[i],
if (ac->controls[i]->oid == NULL) {
ret = LDB_ERR_OPERATIONS_ERROR;
return ldb_module_done(
- ac->req, ac->controls, ares->response, ret);
+ ac->req, ac->controls, response, ret);
}
ac->controls[i]->critical = 0;
if (vlv == NULL) {
ret = LDB_ERR_OPERATIONS_ERROR;
return ldb_module_done(
- ac->req, ac->controls, ares->response, ret);
+ ac->req, ac->controls, response, ret);
}
ac->controls[i]->data = vlv;
ret = vlv_results(ac, NULL);
if (ret != LDB_SUCCESS) {
+ /*
+ * vlv_results() will have called ldb_module_done
+ * if there was an error.
+ */
return ret;
}
return ldb_module_done(req, ac->controls, NULL,