From: Jeremy Allison Date: Fri, 2 Aug 2013 22:03:39 +0000 (-0700) Subject: Fix bug #10063 - source3/lib/util.c:1493 leaking memory w/ pam_winbind.so / winbind X-Git-Tag: talloc-2.1.0~100 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9423d5afb71e272298f4858d82f436e19ee2b07f;p=thirdparty%2Fsamba.git 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 Reviewed-by: Simo Sorce Autobuild-User(master): Simo Sorce Autobuild-Date(master): Sat Aug 24 02:28:28 CEST 2013 on sn-devel-104 --- diff --git a/source3/lib/util.c b/source3/lib/util.c index bf6c8c53027..51680923fdd 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); }