From: Tom Yu Date: Tue, 9 Mar 1999 03:41:29 +0000 (+0000) Subject: * sendauth.c (krb5_sendauth): Set credspout to NULL if it's X-Git-Tag: krb5-1.1-beta1~308 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c7969748c8feeedd604e5ff8dc8c97563759e74d;p=krb5.git * sendauth.c (krb5_sendauth): Set credspout to NULL if it's destined to be returned to avoid freeing it. Also, unconditionally free credspout if it's non-NULL so that if someone doesn't pass in a ticket and doesn't give us a non-NULL out_creds, we don't leak it. [krb5-libs/699] git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11249 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index 81d680598..b5d517def 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,11 @@ +Mon Mar 8 22:39:01 1999 Tom Yu + + * sendauth.c (krb5_sendauth): Set credspout to NULL if it's + destined to be returned to avoid freeing it. Also, + unconditionally free credspout if it's non-NULL so that if someone + doesn't pass in a ticket and doesn't give us a non-NULL out_creds, + we don't leak it. [krb5-libs/699] + 1998-11-13 Theodore Ts'o * Makefile.in: Set the myfulldir and mydir variables (which are diff --git a/src/lib/krb5/krb/sendauth.c b/src/lib/krb5/krb/sendauth.c index 348094c7c..343611830 100644 --- a/src/lib/krb5/krb/sendauth.c +++ b/src/lib/krb5/krb/sendauth.c @@ -213,12 +213,13 @@ krb5_sendauth(context, auth_context, } retval = 0; /* Normal return */ if (out_creds) { - *out_creds = credsp; + *out_creds = credsp; + credspout = NULL; } error_return: krb5_free_cred_contents(context, &creds); - if (!out_creds && credspout) + if (credspout != NULL) krb5_free_creds(context, credspout); if (!ccache && use_ccache) krb5_cc_close(context, use_ccache);