From da14a74df9eeb64d6168e7d13412ac1519c39717 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 28 May 2019 13:11:14 +0200 Subject: setpriv: fix memory leak in local scope [coverity scan] Signed-off-by: Karel Zak --- sys-utils/setpriv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sys-utils') 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); -- cgit v1.2.3-55-g7522