Make us clean under valgrind --leak-check=full by using talloc_autofree_context(...
[samba.git] / source3 / utils / smbpasswd.c
index 600fe52f0d7c4401d9852831e60d6a6679360e36..d2652ad95a55fbf45a3cf7297f52846f51155501 100644 (file)
@@ -337,7 +337,7 @@ static int process_root(int local_flags)
                load_interfaces();
        }
 
-       if (!user_name[0] && (pwd = getpwuid_alloc(NULL, geteuid()))) {
+       if (!user_name[0] && (pwd = getpwuid_alloc(talloc_autofree_context(), geteuid()))) {
                fstrcpy(user_name, pwd->pw_name);
                TALLOC_FREE(pwd);
        } 
@@ -498,7 +498,7 @@ static int process_nonroot(int local_flags)
        }
 
        if (!user_name[0]) {
-               pwd = getpwuid_alloc(NULL, getuid());
+               pwd = getpwuid_alloc(talloc_autofree_context(), getuid());
                if (pwd) {
                        fstrcpy(user_name,pwd->pw_name);
                        TALLOC_FREE(pwd);