summaryrefslogtreecommitdiff
path: root/libmisc/setupenv.c
diff options
context:
space:
mode:
authorChristian Perrier <bubulle@debian.org>2014-03-01 19:59:36 +0100
committerChristian Perrier <bubulle@debian.org>2014-03-01 19:59:36 +0100
commit65b471a2f27acb2f3ce378106eb8aeba8b496557 (patch)
tree29941e07f9b1d7c9a44a08b65782505eb6ef58a5 /libmisc/setupenv.c
parentdb1dc7288b64873f4f39e8404fd99c1bf55c7a8b (diff)
downloadshadow-65b471a2f27acb2f3ce378106eb8aeba8b496557.tar.gz
Imported Upstream version 4.2upstream/4.2
Diffstat (limited to 'libmisc/setupenv.c')
-rw-r--r--libmisc/setupenv.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libmisc/setupenv.c b/libmisc/setupenv.c
index 666b1c7b..8020f3d5 100644
--- a/libmisc/setupenv.c
+++ b/libmisc/setupenv.c
@@ -36,7 +36,7 @@
#include <config.h>
-#ident "$Id: setupenv.c 3232 2010-08-22 19:13:53Z nekral-guest $"
+#ident "$Id$"
#include <assert.h>
#include <sys/types.h>
@@ -228,7 +228,8 @@ void setup_env (struct passwd *info)
exit (EXIT_FAILURE);
}
(void) puts (_("No directory, logging in with HOME=/"));
- info->pw_dir = temp_pw_dir;
+ free (info->pw_dir);
+ info->pw_dir = xstrdup (temp_pw_dir);
}
/*
@@ -244,7 +245,8 @@ void setup_env (struct passwd *info)
if ((NULL == info->pw_shell) || ('\0' == *info->pw_shell)) {
static char temp_pw_shell[] = SHELL;
- info->pw_shell = temp_pw_shell;
+ free (info->pw_shell);
+ info->pw_shell = xstrdup (temp_pw_shell);
}
addenv ("SHELL", info->pw_shell);