The credentials are not needed right before pam_end. Drop the call,
which avoids the requirement of cleaning them up again.
While at it, supply the last retcode into pam_end, even though it's
always 0 anyway.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
if (pam_fail_check(pamh, retcode))
return FALSE;
- retcode = pam_setcred(pamh, 0);
- if (pam_fail_check(pamh, retcode))
- return FALSE;
-
- pam_end(pamh, 0);
+ pam_end(pamh, retcode);
/* no need to establish a session; this isn't a
* session-oriented activity... */
}