Make us clean under valgrind --leak-check=full by using talloc_autofree_context(...
commit5c57837283599cb1cedd0fba1739e53ea255db97
authorJeremy Allison <jra@samba.org>
Fri, 7 Nov 2008 04:50:11 +0000 (6 20:50 -0800)
committerKarolin Seeger <kseeger@samba.org>
Tue, 18 Nov 2008 09:06:51 +0000 (18 10:06 +0100)
treee8b6da5d9692123e0d8193ac99f7d225b7568bf2
parent30482d06d9a34801c567fdee18d4af76b0196c76
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)
15 files changed:
source/auth/token_util.c
source/lib/genrand.c
source/lib/memcache.c
source/lib/util.c
source/lib/util_pw.c
source/param/loadparm.c
source/passdb/passdb.c
source/passdb/pdb_interface.c
source/passdb/util_unixsids.c
source/smbd/server.c
source/smbd/uid.c
source/utils/net_sam.c
source/utils/pdbedit.c
source/utils/smbpasswd.c
source/web/cgi.c