Avoid a strdup, use a talloc_reference
Use the shortest term memory context possible
Andrew Bartlett
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
- a_state = talloc_p(d_state, struct samr_account_state);
+ a_state = talloc_p(mem_ctx, struct samr_account_state);
if (!a_state) {
return NT_STATUS_NO_MEMORY;
}
return NT_STATUS_NO_MEMORY;
}
- msg->dn = talloc_strdup(mem_ctx, a_state->account_dn);
+ msg->dn = talloc_reference(mem_ctx, a_state->account_dn);
if (!msg->dn) {
return NT_STATUS_NO_MEMORY;
}