summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/id.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/id.c b/src/id.c
index 9ee52e1fc..a178714fd 100644
--- a/src/id.c
+++ b/src/id.c
@@ -211,7 +211,7 @@ of a different user"));
struct passwd const *pwd;
euid = geteuid ();
pwd = getpwuid (euid);
- user_name = pwd ? pwd->pw_name : NULL;
+ user_name = pwd ? xstrdup (pwd->pw_name) : NULL;
ruid = getuid ();
egid = getegid ();
rgid = getgid ();