]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix an error case in krb5_sendauth
authorGreg Hudson <ghudson@mit.edu>
Thu, 28 Mar 2013 06:08:45 +0000 (02:08 -0400)
committerGreg Hudson <ghudson@mit.edu>
Thu, 28 Mar 2013 06:08:45 +0000 (02:08 -0400)
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

index b1dde3c7550c6d33ab37115174de4ad13470114c..f7e6777411aacb54957a7bd97a225e79e9a5f870 100644 (file)
@@ -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.