summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2013-08-02 15:03:39 -0700
committerSimo Sorce <idra@samba.org>2013-08-24 02:28:28 +0200
commit9423d5afb71e272298f4858d82f436e19ee2b07f (patch)
treecae89a0bc85778d493c80727dbc38714ab0378f7 /source3
parent3ddb77f7d8d56376661c9ad26acbb32dc7e6e40d (diff)
downloadsamba-9423d5afb71e272298f4858d82f436e19ee2b07f.tar.gz
samba-9423d5afb71e272298f4858d82f436e19ee2b07f.tar.bz2
samba-9423d5afb71e272298f4858d82f436e19ee2b07f.zip
Fix bug #10063 - source3/lib/util.c:1493 leaking memory w/ pam_winbind.so / winbind
Don't use talloc_tos() in something that can be linked to in pam_winbindd.so Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Simo Sorce <idra@samba.org> Autobuild-User(master): Simo Sorce <idra@samba.org> Autobuild-Date(master): Sat Aug 24 02:28:28 CEST 2013 on sn-devel-104
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/util.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index bf6c8c5302..51680923fd 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -1462,10 +1462,12 @@ char *myhostname(void)
char *myhostname_upper(void)
{
- char *name;
static char *ret;
if (ret == NULL) {
- name = get_myname(talloc_tos());
+ char *name = get_myname(NULL);
+ if (name == NULL) {
+ return NULL;
+ }
ret = strupper_talloc(NULL, name);
talloc_free(name);
}