Use talloc_memdup() instead of a manual copy.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
}
if (_current != NULL) {
- *_current = talloc(mem_ctx, struct samr_Password);
+ *_current = talloc_memdup(mem_ctx, current, sizeof(*current));
if (*_current == NULL) {
TALLOC_FREE(frame);
return NT_STATUS_NO_MEMORY;
}
- **_current = *current;
}
if (_previous != NULL) {
- *_previous = talloc(mem_ctx, struct samr_Password);
+ *_previous =
+ talloc_memdup(mem_ctx, previous, sizeof(*previous));
if (*_previous == NULL) {
if (_current != NULL) {
TALLOC_FREE(*_current);
TALLOC_FREE(frame);
return NT_STATUS_NO_MEMORY;
}
- **_previous = *previous;
}
ZERO_STRUCTP(current);
ZERO_STRUCTP(previous);