summaryrefslogtreecommitdiff
path: root/source3/web
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-11-06 20:48:13 -0800
committerJeremy Allison <jra@samba.org>2008-11-06 20:48:13 -0800
commit8962be69c700224983af4effd2cd086f7f5800b0 (patch)
treead2149c31ca5102a213a13a75cd511b11c64d812 /source3/web
parent7ae625345536572aa946f0715542a5cf2dbc2169 (diff)
downloadsamba-8962be69c700224983af4effd2cd086f7f5800b0.tar.gz
samba-8962be69c700224983af4effd2cd086f7f5800b0.tar.bz2
samba-8962be69c700224983af4effd2cd086f7f5800b0.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.
Diffstat (limited to 'source3/web')
-rw-r--r--source3/web/cgi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/web/cgi.c b/source3/web/cgi.c
index ce36bd9310..49e83717c3 100644
--- a/source3/web/cgi.c
+++ b/source3/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.