From: Theodore Tso Date: Tue, 18 Aug 1992 23:21:22 +0000 (+0000) Subject: Make sure the right structures actually get copied instead of aliased, and X-Git-Tag: krb5-1.0-beta2~132 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1d68b54d57acac7afe4aa686425259cb92d62eda;p=krb5.git Make sure the right structures actually get copied instead of aliased, and make sure everything gets freed on an error return. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2330 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/krb/sendauth.c b/src/lib/krb5/krb/sendauth.c index 30bd54e70..cb3180495 100644 --- a/src/lib/krb5/krb/sendauth.c +++ b/src/lib/krb5/krb/sendauth.c @@ -119,9 +119,12 @@ krb5_sendauth(/* IN */ if (!credsp) { if (!ccache) return(KRB5_NOCREDS_SUPPLIED); - creds.server = (krb5_principal) server; - if (retval = krb5_copy_principal(client, &creds.client)) + if (retval = krb5_copy_principal(server, &creds.server)) return(retval); + if (retval = krb5_copy_principal(client, &creds.client)) { + krb5_free_principal(creds.server); + return(retval); + } /* creds.times.endtime = 0; -- memset 0 takes care of this zero means "as long as possible" */ /* creds.keyblock.keytype = 0; -- as well as this.