summaryrefslogtreecommitdiff
path: root/source4/auth/auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/auth/auth.c')
-rw-r--r--source4/auth/auth.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/source4/auth/auth.c b/source4/auth/auth.c
index ba1e6fd0e5..1ad5332b28 100644
--- a/source4/auth/auth.c
+++ b/source4/auth/auth.c
@@ -455,13 +455,14 @@ NTSTATUS auth_register(const struct auth_operations *ops)
return NT_STATUS_OBJECT_NAME_COLLISION;
}
- backends = realloc_p(backends, struct auth_backend, num_backends+1);
- if (!backends) {
- return NT_STATUS_NO_MEMORY;
- }
-
- new_ops = smb_xmemdup(ops, sizeof(*ops));
- new_ops->name = smb_xstrdup(ops->name);
+ backends = talloc_realloc(talloc_autofree_context(), backends,
+ struct auth_backend, num_backends+1);
+ NT_STATUS_HAVE_NO_MEMORY(backends);
+
+ new_ops = talloc_memdup(backends, ops, sizeof(*ops));
+ NT_STATUS_HAVE_NO_MEMORY(new_ops);
+ new_ops->name = talloc_strdup(new_ops, ops->name);
+ NT_STATUS_HAVE_NO_MEMORY(new_ops->name);
backends[num_backends].ops = new_ops;