Bug 6554 - Wrong deallocation in sam_account_ok
Summary: Wrong deallocation in sam_account_ok
Status: RESOLVED INVALID
Alias: None
Product: Samba 3.4
Classification: Unclassified
Component: User & Group Accounts (show other bugs)
Version: 3.4.0
Hardware: Other All
: P3 minor
Target Milestone: ---
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-16 02:19 UTC by Jean-Jacques METAYER
Modified: 2009-07-16 11:52 UTC (History)
0 users

See Also:


Attachments
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 !

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

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