From 1d68b54d57acac7afe4aa686425259cb92d62eda Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Tue, 18 Aug 1992 23:21:22 +0000 Subject: [PATCH] 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 --- src/lib/krb5/krb/sendauth.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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. -- 2.26.2