summaryrefslogtreecommitdiff
path: root/source3/auth
diff options
context:
space:
mode:
Diffstat (limited to 'source3/auth')
-rw-r--r--source3/auth/auth.c10
-rw-r--r--source3/auth/auth_sam.c5
2 files changed, 5 insertions, 10 deletions
diff --git a/source3/auth/auth.c b/source3/auth/auth.c
index fd4c503752..ce8722a1b4 100644
--- a/source3/auth/auth.c
+++ b/source3/auth/auth.c
@@ -82,7 +82,6 @@ static void get_ntlm_challenge(struct auth_context *auth_context,
DATA_BLOB challenge = data_blob_null;
const char *challenge_set_by = NULL;
auth_methods *auth_method;
- TALLOC_CTX *mem_ctx;
if (auth_context->challenge.length) {
DEBUG(5, ("get_ntlm_challenge (auth subsystem): returning previous challenge by module %s (normal)\n",
@@ -106,12 +105,8 @@ static void get_ntlm_challenge(struct auth_context *auth_context,
continue;
}
- mem_ctx = talloc_init("auth_get_challenge for module %s", auth_method->name);
- if (!mem_ctx) {
- smb_panic("talloc_init() failed!");
- }
-
- challenge = auth_method->get_chal(auth_context, &auth_method->private_data, mem_ctx);
+ challenge = auth_method->get_chal(auth_context, &auth_method->private_data,
+ auth_context->mem_ctx);
if (!challenge.length) {
DEBUG(3, ("auth_get_challenge: getting challenge from authentication method %s FAILED.\n",
auth_method->name));
@@ -121,7 +116,6 @@ static void get_ntlm_challenge(struct auth_context *auth_context,
challenge_set_by = auth_method->name;
auth_context->challenge_set_method = auth_method;
}
- talloc_destroy(mem_ctx);
}
if (!challenge_set_by) {
diff --git a/source3/auth/auth_sam.c b/source3/auth/auth_sam.c
index a2634feb6c..26b45e47e5 100644
--- a/source3/auth/auth_sam.c
+++ b/source3/auth/auth_sam.c
@@ -226,10 +226,10 @@ static NTSTATUS sam_account_ok(TALLOC_CTX *mem_ctx,
if (*workstation_list) {
bool invalid_ws = True;
- char *tok;
+ char *tok = NULL;
const char *s = workstation_list;
+ char *machine_name = talloc_asprintf(mem_ctx, "%s$", user_info->wksta_name);
- const char *machine_name = talloc_asprintf(mem_ctx, "%s$", user_info->wksta_name);
if (machine_name == NULL)
return NT_STATUS_NO_MEMORY;
@@ -251,6 +251,7 @@ static NTSTATUS sam_account_ok(TALLOC_CTX *mem_ctx,
TALLOC_FREE(tok);
}
TALLOC_FREE(tok);
+ TALLOC_FREE(machine_name);
if (invalid_ws)
return NT_STATUS_INVALID_WORKSTATION;