In both cases, pwd is freed immediately
- 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);
}
fstrcpy(user_name, pwd->pw_name);
TALLOC_FREE(pwd);
}
- pwd = getpwuid_alloc(talloc_autofree_context(), getuid());
+ pwd = getpwuid_alloc(talloc_tos(), getuid());
if (pwd) {
fstrcpy(user_name,pwd->pw_name);
TALLOC_FREE(pwd);
if (pwd) {
fstrcpy(user_name,pwd->pw_name);
TALLOC_FREE(pwd);