summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys-utils/setpriv.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys-utils/setpriv.c b/sys-utils/setpriv.c
index 717031d94..e612f7269 100644
--- a/sys-utils/setpriv.c
+++ b/sys-utils/setpriv.c
@@ -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);