setpriv: fix memory leak in local scope [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
cf5debba06
commit
da14a74df9
|
@ -700,8 +700,10 @@ static void do_reset_environ(struct passwd *pw)
|
|||
#else
|
||||
environ = NULL;
|
||||
#endif
|
||||
if (term)
|
||||
if (term) {
|
||||
xsetenv("TERM", term, 1);
|
||||
free(term);
|
||||
}
|
||||
|
||||
if (pw->pw_shell && *pw->pw_shell)
|
||||
xsetenv("SHELL", pw->pw_shell, 1);
|
||||
|
|
Loading…
Reference in New Issue