summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2005-01-11 13:59:18 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:08:42 -0500
commitfdebf9dd4c87dcb9367d506577b55013ff5febd0 (patch)
treea0d6d5928f0c4b086273b54116497c1390a5f679
parent0a0dbc37f3b4c2ef1092777ecfcf5397b3741dab (diff)
downloadsamba-fdebf9dd4c87dcb9367d506577b55013ff5febd0.tar.gz
samba-fdebf9dd4c87dcb9367d506577b55013ff5febd0.tar.bz2
samba-fdebf9dd4c87dcb9367d506577b55013ff5febd0.zip
r4680: Make more efficient use of memory in SAMR:
Avoid a strdup, use a talloc_reference Use the shortest term memory context possible Andrew Bartlett (This used to be commit 5569db0f94807b7e2418630fbdca03be9c65e838)
-rw-r--r--source4/rpc_server/samr/dcesrv_samr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source4/rpc_server/samr/dcesrv_samr.c b/source4/rpc_server/samr/dcesrv_samr.c
index 9f0b8d4801..a98fe5ae06 100644
--- a/source4/rpc_server/samr/dcesrv_samr.c
+++ b/source4/rpc_server/samr/dcesrv_samr.c
@@ -2391,7 +2391,7 @@ static NTSTATUS samr_OpenUser(struct dcesrv_call_state *dce_call, TALLOC_CTX *me
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;
}
@@ -2649,7 +2649,7 @@ static NTSTATUS samr_SetUserInfo(struct dcesrv_call_state *dce_call, TALLOC_CTX
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;
}