diff options
author | Davidlohr Bueso <dave@gnu.org> | 2010-11-29 09:27:11 -0300 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2010-11-30 13:18:18 +0100 |
commit | 3e31a2dfaf5c42ddd3d0c003eda9cf81448bf5f1 (patch) | |
tree | 8ae91d40494bedbf11a3df3a636f32b56594ef32 /login-utils | |
parent | 4b5156cbfa365048c2b5e794c41cc201a49bf878 (diff) | |
download | util-linux-old-3e31a2dfaf5c42ddd3d0c003eda9cf81448bf5f1.tar.gz |
login: use xalloc lib
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Diffstat (limited to 'login-utils')
-rw-r--r-- | login-utils/login.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/login-utils/login.c b/login-utils/login.c index 68eb84bc..1802d3a2 100644 --- a/login-utils/login.c +++ b/login-utils/login.c @@ -115,7 +115,7 @@ #include "login.h" #include "strutils.h" #include "nls.h" - +#include "xalloc.h" #ifdef HAVE_SECURITY_PAM_MISC_H # include <security/pam_appl.h> @@ -1240,12 +1240,7 @@ Michael Riepe <michael@stud.uni-hannover.de> /* if the shell field has a space: treat it like a shell script */ if (strchr(pwd->pw_shell, ' ')) { - buff = malloc(strlen(pwd->pw_shell) + 6); - - if (!buff) { - fprintf(stderr, _("login: no memory for shell script.\n")); - exit(0); - } + buff = xmalloc(strlen(pwd->pw_shell) + 6); strcpy(buff, "exec "); strcat(buff, pwd->pw_shell); |