summaryrefslogtreecommitdiffstats
path: root/src/lib/krb5
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2013-03-28 02:08:45 -0400
committerGreg Hudson <ghudson@mit.edu>2013-03-28 02:08:45 -0400
commitc4549f8f91fe53830f1e7d68d6d1f7b1a117a911 (patch)
tree1465fed7b86eb0b65d6c8805fa190d4f4d419f38 /src/lib/krb5
parent58871c23ee9b5a9201f479127fda65e7fcf06310 (diff)
downloadkrb5-c4549f8f91fe53830f1e7d68d6d1f7b1a117a911.tar.gz
krb5-c4549f8f91fe53830f1e7d68d6d1f7b1a117a911.tar.xz
krb5-c4549f8f91fe53830f1e7d68d6d1f7b1a117a911.zip
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.
Diffstat (limited to 'src/lib/krb5')
-rw-r--r--src/lib/krb5/krb/sendauth.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/lib/krb5/krb/sendauth.c b/src/lib/krb5/krb/sendauth.c
index b1dde3c755..f7e6777411 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.