In the source3/sam/sam_auth.c file line 216, there is a deallocation of "tok", while I think it should be "machine_name"
Actually, it shouldn't - neither of the TALLOC_FREE(tok) calls are strictly needed here, due to the fact the memory allocation is being done on the containing context (which will be freed later). an additional free of machine_name here won't hurt, but as tok is set to zero within next_token_talloc() this is actually already quite safe. Thanks for looking closely at the code though ! Jeremy.
Created attachment 4432 [details] Tidyup. Here is what the tidyup looks like I'll add into master. Thanks. Jeremy.