summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew G. Morgan <morgan@kernel.org>2001-11-27 05:15:37 +0000
committerAndrew G. Morgan <morgan@kernel.org>2001-11-27 05:15:37 +0000
commitdb864534d2f54492b21cd11e2838a2b77291fcc0 (patch)
tree3b3fc98d37bcc274c56ebc78a8c58f72d8bbdc1d
parentfc78bb8523d8d6a2c90ded155b555e956156c2b1 (diff)
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.
-rw-r--r--CHANGELOG2
-rw-r--r--modules/pam_unix/pam_unix_auth.c8
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: ");