diff options
author | Tom Yu <tlyu@mit.edu> | 1999-03-09 03:41:29 +0000 |
---|---|---|
committer | Tom Yu <tlyu@mit.edu> | 1999-03-09 03:41:29 +0000 |
commit | c7969748c8feeedd604e5ff8dc8c97563759e74d (patch) | |
tree | ae2a102a5c8be620f62bbc48077478e1cefdf06b /src/lib/krb5/krb | |
parent | c8f2a6b57b0d97f46136ffc04e30edf356de0531 (diff) | |
download | krb5-c7969748c8feeedd604e5ff8dc8c97563759e74d.tar.gz krb5-c7969748c8feeedd604e5ff8dc8c97563759e74d.tar.xz krb5-c7969748c8feeedd604e5ff8dc8c97563759e74d.zip |
* 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
Diffstat (limited to 'src/lib/krb5/krb')
-rw-r--r-- | src/lib/krb5/krb/ChangeLog | 8 | ||||
-rw-r--r-- | src/lib/krb5/krb/sendauth.c | 5 |
2 files changed, 11 insertions, 2 deletions
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 <tlyu@mit.edu> + + * 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 <tytso@rsts-11.mit.edu> * 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); |