Fix bug #10063 - source3/lib/util.c:1493 leaking memory w/ pam_winbind.so / winbind
authorJeremy Allison <jra@samba.org>
Fri, 2 Aug 2013 22:03:39 +0000 (15:03 -0700)
committerSimo Sorce <idra@samba.org>
Sat, 24 Aug 2013 00:28:28 +0000 (02:28 +0200)
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

source3/lib/util.c

index bf6c8c530277e921e49721eb5bfc9e25b67ad7fc..51680923fddfc4b93ddbe14ac603fb6954599121 100644 (file)
@@ -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);
        }