summaryrefslogtreecommitdiff
path: root/source4/auth/auth_sam.c
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/auth/auth_sam.c
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/auth/auth_sam.c')
-rw-r--r--source4/auth/auth_sam.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/source4/auth/auth_sam.c b/source4/auth/auth_sam.c
index 5239d6f413..74c8edcb82 100644
--- a/source4/auth/auth_sam.c
+++ b/source4/auth/auth_sam.c
@@ -332,19 +332,19 @@ static NTSTATUS check_sam_security(const struct auth_context *auth_context,
if (group_ret > 0 &&
!(groupSIDs = talloc_realloc_p(groupSIDs,
struct dom_sid *, group_ret))) {
- talloc_destroy((*server_info)->mem_ctx);
+ talloc_free(*server_info);
return NT_STATUS_NO_MEMORY;
}
/* Need to unroll some nested groups, but not aliases */
for (i = 0; i < group_ret; i++) {
sidstr = ldb_msg_find_string(group_msgs[i], "objectSid", NULL);
- groupSIDs[i] = dom_sid_parse_talloc((*server_info)->mem_ctx, sidstr);
+ groupSIDs[i] = dom_sid_parse_talloc(*server_info, sidstr);
}
sidstr = ldb_msg_find_string(msgs[0], "objectSid", NULL);
- user_sid = dom_sid_parse_talloc((*server_info)->mem_ctx, sidstr);
- primary_group_sid = dom_sid_parse_talloc((*server_info)->mem_ctx, sidstr);
+ user_sid = dom_sid_parse_talloc(*server_info, sidstr);
+ primary_group_sid = dom_sid_parse_talloc(*server_info, sidstr);
primary_group_sid->sub_auths[primary_group_sid->num_auths-1]
= samdb_result_uint(msgs[0], "primaryGroupID", 0);
@@ -356,29 +356,29 @@ static NTSTATUS check_sam_security(const struct auth_context *auth_context,
}
(*server_info)->account_name
- = talloc_strdup((*server_info)->mem_ctx,
+ = talloc_strdup(*server_info,
samdb_result_string(msgs[0], "sAMAccountName", ""));
(*server_info)->domain
- = talloc_strdup((*server_info)->mem_ctx,
+ = talloc_strdup(*server_info,
samdb_result_string(msgs_domain[0], "name", ""));
(*server_info)->full_name
- = talloc_strdup((*server_info)->mem_ctx,
+ = talloc_strdup(*server_info,
samdb_result_string(msgs[0], "displayName", ""));
(*server_info)->logon_script
- = talloc_strdup((*server_info)->mem_ctx,
+ = talloc_strdup(*server_info,
samdb_result_string(msgs[0], "scriptPath", ""));
(*server_info)->profile_path
- = talloc_strdup((*server_info)->mem_ctx,
+ = talloc_strdup(*server_info,
samdb_result_string(msgs[0], "profilePath", ""));
(*server_info)->home_directory
- = talloc_strdup((*server_info)->mem_ctx,
+ = talloc_strdup(*server_info,
samdb_result_string(msgs[0], "homeDirectory", ""));
(*server_info)->home_drive
- = talloc_strdup((*server_info)->mem_ctx,
+ = talloc_strdup(*server_info,
samdb_result_string(msgs[0], "homeDrive", ""));
(*server_info)->last_logon = samdb_result_nttime(msgs[0], "lastLogon", 0);
@@ -408,7 +408,7 @@ static NTSTATUS check_sam_security(const struct auth_context *auth_context,
|| !(*server_info)->profile_path
|| !(*server_info)->home_directory
|| !(*server_info)->home_drive) {
- talloc_destroy((*server_info)->mem_ctx);
+ talloc_destroy(*server_info);
return NT_STATUS_NO_MEMORY;
}