From db864534d2f54492b21cd11e2838a2b77291fcc0 Mon Sep 17 00:00:00 2001 From: "Andrew G. Morgan" Date: Tue, 27 Nov 2001 05:15:37 +0000 Subject: Relevant BUGIDs: 483959 Purpose of commit: fix memory leak Commit summary: --------------- Fernando Trias pointed out a silly memory leak in pam_unix.so. It looks like some allocated memory that is simply not needed for anything. --- CHANGELOG | 2 ++ modules/pam_unix/pam_unix_auth.c | 8 ++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 9e342d85..65c4d9bf 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -49,6 +49,8 @@ bug report - outstanding bugs are listed here: 0.76: please submit patches for this section with actual code/doc patches! +* pam_unix: fixed bizarre memory leak pointed out by Fernando Trias + (Bug 483959 - agmorgan) * misc string comparison length checking changes from Nalin. Modules touched, pam_cracklib, pam_listfile, pam_unix, pam_wheel (Bug 476947 - agmorgan) diff --git a/modules/pam_unix/pam_unix_auth.c b/modules/pam_unix/pam_unix_auth.c index f08ea515..f55ae469 100644 --- a/modules/pam_unix/pam_unix_auth.c +++ b/modules/pam_unix/pam_unix_auth.c @@ -82,7 +82,7 @@ #define AUTH_RETURN \ { \ - if (on(UNIX_LIKE_AUTH, ctrl) && ret_data) { \ + if (on(UNIX_LIKE_AUTH, ctrl)) { \ D(("recording return code for next time [%d]", \ retval)); \ pam_set_data(pamh, "unix_setcred_return", \ @@ -96,17 +96,13 @@ PAM_EXTERN int pam_sm_authenticate(pam_handle_t * pamh, int flags ,int argc, const char **argv) { unsigned int ctrl; - int retval, *ret_data = NULL; + int retval; const char *name, *p; D(("called.")); ctrl = _set_ctrl(pamh, flags, NULL, argc, argv); - /* Get a few bytes so we can pass our return value to - pam_sm_setcred(). */ - ret_data = malloc(sizeof(int)); - /* get the user'name' */ retval = pam_get_user(pamh, &name, "login: "); -- cgit v1.2.3