const struct ldb_message *user_msg,
struct ldb_message **current)
{
+ TALLOC_CTX *tmp_ctx = NULL;
const struct ldb_val *v = NULL;
struct ldb_result *res = NULL;
uint16_t acct_flags = 0;
NTSTATUS status = NT_STATUS_OK;
int ret;
+ tmp_ctx = talloc_new(mem_ctx);
+ if (tmp_ctx == NULL) {
+ status = NT_STATUS_NO_MEMORY;
+ goto out;
+ }
+
/*
* Re-read the account details, using the GUID in case the DN
* is being changed (this is automatic in LDB because the
* subset to ensure that we can reuse existing validation code.
*/
ret = dsdb_search_dn(sam_ctx,
- mem_ctx,
+ tmp_ctx,
&res,
user_msg->dn,
user_attrs,
}
*current = talloc_steal(mem_ctx, res->msgs[0]);
out:
- TALLOC_FREE(res);
+ TALLOC_FREE(tmp_ctx);
return status;
}