From c4549f8f91fe53830f1e7d68d6d1f7b1a117a911 Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Thu, 28 Mar 2013 02:08:45 -0400 Subject: 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 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib/krb5/krb/sendauth.c b/src/lib/krb5/krb/sendauth.c index b1dde3c75..f7e677741 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. -- cgit