krb5 commit: Fix an error case in krb5_sendauth

Greg Hudson ghudson at MIT.EDU
Thu Mar 28 02:49:32 EDT 2013


https://github.com/krb5/krb5/commit/c4549f8f91fe53830f1e7d68d6d1f7b1a117a911
commit c4549f8f91fe53830f1e7d68d6d1f7b1a117a911
Author: Greg Hudson <ghudson at mit.edu>
Date:   Thu Mar 28 02:08:45 2013 -0400

    Fix an error case in krb5_sendauth
    
    If we fail to get the client principal when constructing the
    stack-allocated creds structure, don't double-free creds.server.

 src/lib/krb5/krb/sendauth.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/src/lib/krb5/krb/sendauth.c b/src/lib/krb5/krb/sendauth.c
index b1dde3c..f7e6777 100644
--- a/src/lib/krb5/krb/sendauth.c
+++ b/src/lib/krb5/krb/sendauth.c
@@ -108,10 +108,8 @@ krb5_sendauth(krb5_context context, krb5_auth_context *auth_context,
         else
             retval = krb5_cc_get_principal(context, use_ccache,
                                            &creds.client);
-        if (retval) {
-            krb5_free_principal(context, creds.server);
+        if (retval)
             goto error_return;
-        }
         /* creds.times.endtime = 0; -- memset 0 takes care of this
            zero means "as long as possible" */
         /* creds.keyblock.enctype = 0; -- as well as this.


More information about the cvs-krb5 mailing list