summaryrefslogtreecommitdiffstats
path: root/source/auth
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-11-06 20:50:11 -0800
committerKarolin Seeger <kseeger@samba.org>2008-11-18 10:06:51 +0100
commit5c57837283599cb1cedd0fba1739e53ea255db97 (patch)
treee8b6da5d9692123e0d8193ac99f7d225b7568bf2 /source/auth
parent30482d06d9a34801c567fdee18d4af76b0196c76 (diff)
downloadsamba-5c57837283599cb1cedd0fba1739e53ea255db97.tar.gz
samba-5c57837283599cb1cedd0fba1739e53ea255db97.tar.xz
samba-5c57837283599cb1cedd0fba1739e53ea255db97.zip
Make us clean under valgrind --leak-check=full by using talloc_autofree_context() instead of NULL.
Remove the code in memcache that does a TALLOC_FREE on stored pointers. That's a disaster waiting to happen. If you're storing talloc'ed pointers, you can't know their lifecycle and they should be deleted when their parent context is deleted, so freeing them at some arbitrary point later will be a double-free. Jeremy. (cherry picked from commit 33013e40f5f4fb639ad0d3a9bd8565cd18062165)
Diffstat (limited to 'source/auth')
-rw-r--r--source/auth/token_util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/auth/token_util.c b/source/auth/token_util.c
index d6cd2ea3a84..bb8f222abf6 100644
--- a/source/auth/token_util.c
+++ b/source/auth/token_util.c
@@ -102,7 +102,7 @@ NT_USER_TOKEN *get_root_nt_token( void )
uid_to_sid(&u_sid, pw->pw_uid);
gid_to_sid(&g_sid, pw->pw_gid);
- token = create_local_nt_token(NULL, &u_sid, False,
+ token = create_local_nt_token(talloc_autofree_context(), &u_sid, False,
1, &global_sid_Builtin_Administrators);
token->privileges = se_disk_operators;