Fix a memory leak and reversed arguments
authorSam Hartman <hartmans@mit.edu>
Sat, 20 Jan 1996 04:00:25 +0000 (04:00 +0000)
committerSam Hartman <hartmans@mit.edu>
Sat, 20 Jan 1996 04:00:25 +0000 (04:00 +0000)
in my previous commit.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7342 dc483132-0cff-0310-8789-dd5450dbe970

src/appl/bsd/ChangeLog
src/appl/bsd/krshd.c

index 50d2cbdd7c05a2394f37dbe3dcd1dc7125bc862a..ecd749b997dc064d1d0e92c60a54857d8ea1fce1 100644 (file)
@@ -1,6 +1,8 @@
 Fri Jan 19 10:45:29 1996  Sam Hartman  <hartmans@tertius.mit.edu>
 
        * 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.
 
index 29fc757544bb437525bbe73774b3349b2d1af6b8..77d5fa45243c537b9e8737c05eaf0f2166bb2400 100644 (file)
@@ -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);