s3: Remove talloc_autofree_context() from smbpasswd
authorVolker Lendecke <vl@samba.org>
Sat, 25 Sep 2010 23:28:21 +0000 (16:28 -0700)
committerVolker Lendecke <vl@samba.org>
Sun, 26 Sep 2010 01:29:29 +0000 (03:29 +0200)
In both cases, pwd is freed immediately

source3/utils/smbpasswd.c

index 1b68136c687e617328c1751660bad6042f6760e6..2ae7e4dcdfb5fb29eac983edcbab0a7046589b8a 100644 (file)
@@ -342,7 +342,7 @@ static int process_root(int local_flags)
                load_interfaces();
        }
 
-       if (!user_name[0] && (pwd = getpwuid_alloc(talloc_autofree_context(), geteuid()))) {
+       if (!user_name[0] && (pwd = getpwuid_alloc(talloc_tos(), geteuid()))) {
                fstrcpy(user_name, pwd->pw_name);
                TALLOC_FREE(pwd);
        } 
@@ -507,7 +507,7 @@ static int process_nonroot(int local_flags)
        }
 
        if (!user_name[0]) {
-               pwd = getpwuid_alloc(talloc_autofree_context(), getuid());
+               pwd = getpwuid_alloc(talloc_tos(), getuid());
                if (pwd) {
                        fstrcpy(user_name,pwd->pw_name);
                        TALLOC_FREE(pwd);