diff options
author | Alexander Shishkin <virtuoso@slind.org> | 2010-10-27 20:52:40 +0400 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-10-28 07:49:55 +0400 |
commit | 78b286fea51ef137d660b91037c89376115a1994 (patch) | |
tree | 93a7d1485202cb80e226cebde00a9288be2651ce | |
parent | 16cc80e9890c0409921b0463e5678649a893ae7f (diff) |
login: free fromhost upon cleaning up
Signed-off-by: Alexander Shishkin <virtuoso@slind.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | loginutils/login.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/loginutils/login.c b/loginutils/login.c index e104fbb93..3065eaa5b 100644 --- a/loginutils/login.c +++ b/loginutils/login.c @@ -364,6 +364,10 @@ int login_main(int argc UNUSED_PARAM, char **argv) if (++count == 3) { syslog(LOG_WARNING, "invalid password for '%s'%s", username, fromhost); + + if (ENABLE_FEATURE_CLEAN_UP) + free(fromhost); + return EXIT_FAILURE; } username[0] = '\0'; @@ -401,6 +405,9 @@ int login_main(int argc UNUSED_PARAM, char **argv) if (pw->pw_uid == 0) syslog(LOG_INFO, "root login%s", fromhost); + if (ENABLE_FEATURE_CLEAN_UP) + free(fromhost); + /* well, a simple setexeccon() here would do the job as well, * but let's play the game for now */ IF_SELINUX(set_current_security_context(user_sid);) |