X-Git-Url: http://git.samba.org/samba.git/?a=blobdiff_plain;f=source3%2Fauth%2Fauth_sam.c;h=26b45e47e5664821828cc7bc376bb0acad14df1e;hb=5b3a32be97a37c119e837bdee8f049684565458c;hp=a2634feb6c02c4b3ddb014d2946e8672922da8eb;hpb=6c9caed48187a0d18becf59ab636af44cbe521b0;p=ira%2Fwip.git diff --git a/source3/auth/auth_sam.c b/source3/auth/auth_sam.c index a2634feb6c0..26b45e47e56 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;