Bug 6554 - Wrong deallocation in sam_account_ok
Wrong deallocation in sam_account_ok
Product: Samba 3.4
Classification: Unclassified
Component: User & Group Accounts
Other All
: P3 minor
: ---
Assigned To: Samba Bugzilla Account
Samba QA Contact
Depends on:
  Show dependency treegraph
Reported: 2009-07-16 02:19 UTC by Jean-Jacques METAYER
Modified: 2009-07-16 11:52 UTC (History)
0 users

See Also:

Tidyup. (654 bytes, patch)
2009-07-16 11:52 UTC, Jeremy Allison
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Jacques METAYER 2009-07-16 02:19:29 UTC
In the source3/sam/sam_auth.c file line 216, there is a deallocation of "tok", while I think it should be "machine_name"
Comment 1 Jeremy Allison 2009-07-16 11:48:59 UTC
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 !

Comment 2 Jeremy Allison 2009-07-16 11:52:29 UTC
Created attachment 4432 [details]

Here is what the tidyup looks like I'll add into master. Thanks.