From 16d5e1abe3da2319ead2540971f08ef6407b1941 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Tue, 2 Oct 2001 01:06:36 +0000 Subject: [PATCH] * accept_sec_context.c (rd_and_store_for_creds): Handle error returns from krb5_rd_cred more sanely. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13768 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/gssapi/krb5/ChangeLog | 5 +++++ src/lib/gssapi/krb5/accept_sec_context.c | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/lib/gssapi/krb5/ChangeLog b/src/lib/gssapi/krb5/ChangeLog index 4e5a372a0..f036057ac 100644 --- a/src/lib/gssapi/krb5/ChangeLog +++ b/src/lib/gssapi/krb5/ChangeLog @@ -1,3 +1,8 @@ +2001-10-01 Tom Yu + + * accept_sec_context.c (rd_and_store_for_creds): Handle error + returns from krb5_rd_cred more sanely. + 2001-07-27 Danilo Almeida * gssapi_krb5.h: Unmark gss_mech_krb5 variable as an import. diff --git a/src/lib/gssapi/krb5/accept_sec_context.c b/src/lib/gssapi/krb5/accept_sec_context.c index 55845b903..131dffb96 100644 --- a/src/lib/gssapi/krb5/accept_sec_context.c +++ b/src/lib/gssapi/krb5/accept_sec_context.c @@ -84,9 +84,9 @@ rd_and_store_for_creds(context, inbuf, out_cred) krb5_data *inbuf; krb5_gss_cred_id_t *out_cred; { - krb5_creds ** creds; + krb5_creds ** creds = NULL; krb5_error_code retval; - krb5_ccache ccache; + krb5_ccache ccache = NULL; krb5_gss_cred_id_t cred = NULL; extern krb5_cc_ops krb5_mcc_ops; krb5_auth_context auth_context = NULL; @@ -152,7 +152,8 @@ rd_and_store_for_creds(context, inbuf, out_cred) goto cleanup; */ cleanup: - krb5_free_tgt_creds(context, creds); + if (creds) + krb5_free_tgt_creds(context, creds); if (!cred && ccache) (void)krb5_cc_close(context, ccache); -- 2.26.2