summaryrefslogtreecommitdiff
path: root/source4/librpc/rpc
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-09-26 01:43:05 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:59:15 -0500
commit6bea5bea4ccd4eb45b9cd4dd1e16538b14e2180e (patch)
treebd8c95a07360dcf1363cbf49a46db6304893fc63 /source4/librpc/rpc
parent9cafc0d07ed339b511abf0f6fd41c289d2815974 (diff)
downloadsamba-6bea5bea4ccd4eb45b9cd4dd1e16538b14e2180e.tar.gz
samba-6bea5bea4ccd4eb45b9cd4dd1e16538b14e2180e.tar.bz2
samba-6bea5bea4ccd4eb45b9cd4dd1e16538b14e2180e.zip
r2643: convert more of the auth subsyystem to the new talloc methods. This
also fixes a memory leak found with --leak-check. (This used to be commit f19201ea274f0a542314c61c4af676197bf154ad)
Diffstat (limited to 'source4/librpc/rpc')
-rw-r--r--source4/librpc/rpc/dcerpc_schannel.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/source4/librpc/rpc/dcerpc_schannel.c b/source4/librpc/rpc/dcerpc_schannel.c
index 057e20f497..7bb871811a 100644
--- a/source4/librpc/rpc/dcerpc_schannel.c
+++ b/source4/librpc/rpc/dcerpc_schannel.c
@@ -212,25 +212,18 @@ NTSTATUS dcerpc_schannel_session_info(struct gensec_security *gensec_security,
struct auth_session_info **session_info)
{
struct dcerpc_schannel_state *dce_schan_state = gensec_security->private_data;
- TALLOC_CTX *mem_ctx;
- mem_ctx = talloc_init("dcerpc_schannel_start");
- if (!mem_ctx) {
- return NT_STATUS_NO_MEMORY;
- }
- (*session_info) = talloc_p(mem_ctx, struct auth_session_info);
+ (*session_info) = talloc_p(gensec_security, struct auth_session_info);
if (*session_info == NULL) {
- talloc_destroy(mem_ctx);
return NT_STATUS_NO_MEMORY;
}
ZERO_STRUCTP(*session_info);
- (*session_info)->mem_ctx = mem_ctx;
(*session_info)->refcount = 1;
- (*session_info)->workstation = talloc_strdup(mem_ctx, dce_schan_state->account_name);
+ (*session_info)->workstation = talloc_strdup(*session_info, dce_schan_state->account_name);
if ((*session_info)->workstation == NULL) {
- talloc_destroy(mem_ctx);
+ talloc_free(*session_info);
return NT_STATUS_NO_MEMORY;
}
return NT_STATUS_OK;