summaryrefslogtreecommitdiffstats
path: root/source/web
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/web
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/web')
-rw-r--r--source/web/cgi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/web/cgi.c b/source/web/cgi.c
index 070e80cf91d..bcb4ccd8138 100644
--- a/source/web/cgi.c
+++ b/source/web/cgi.c
@@ -314,7 +314,7 @@ static void cgi_web_auth(void)
exit(0);
}
- pwd = getpwnam_alloc(NULL, user);
+ pwd = getpwnam_alloc(talloc_autofree_context(), user);
if (!pwd) {
printf("%sCannot find user %s<br>%s\n", head, user, tail);
exit(0);
@@ -367,7 +367,7 @@ static bool cgi_handle_authorization(char *line)
* Try and get the user from the UNIX password file.
*/
- pass = getpwnam_alloc(NULL, user);
+ pass = getpwnam_alloc(talloc_autofree_context(), user);
/*
* Validate the password they have given.