From: Sam Hartman Date: Sat, 20 Jan 1996 04:00:25 +0000 (+0000) Subject: Fix a memory leak and reversed arguments X-Git-Tag: krb5-1.0-beta6~606 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ef8fc2817d6f77c5913e37d7f4a5299de776087b;p=krb5.git Fix a memory leak and reversed arguments in my previous commit. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7342 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/appl/bsd/ChangeLog b/src/appl/bsd/ChangeLog index 50d2cbdd7..ecd749b99 100644 --- a/src/appl/bsd/ChangeLog +++ b/src/appl/bsd/ChangeLog @@ -1,6 +1,8 @@ Fri Jan 19 10:45:29 1996 Sam Hartman * krshd.c (recvauth): Verify checksum against command line and remote user. + (recvauth): Fix accidental memory leak with authenticator and fix + include correct username in checksum * kcmd.c: Send authenticator with checksum of command line and remote user. diff --git a/src/appl/bsd/krshd.c b/src/appl/bsd/krshd.c index 29fc75754..77d5fa452 100644 --- a/src/appl/bsd/krshd.c +++ b/src/appl/bsd/krshd.c @@ -1709,7 +1709,7 @@ krb5_authenticator *authenticator; goto error_cleanup; strcpy(chksumbuf,cmdbuf); - strcat(chksumbuf,remuser); + strcat(chksumbuf,locuser); if ( status = krb5_verify_checksum(bsd_context, authenticator->checksum->checksum_type, @@ -1720,11 +1720,14 @@ krb5_authenticator *authenticator; goto error_cleanup; error_cleanup: -krb5_free_authenticator(bsd_context, authenticator); krb5_xfree(chksumbuf); -if (status) - return status; + if (status) { + krb5_free_authenticator(bsd_context, authenticator); + return status; + } } + krb5_free_authenticator(bsd_context, authenticator); + /* Setup eblock for encrypted sessions. */ krb5_use_enctype(bsd_context, &eblock, ticket->enc_part2->session->enctype);