summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/gssapi/krb5/accept_sec_context.c4
-rw-r--r--src/lib/krb5/krb/vfy_increds.c7
2 files changed, 7 insertions, 4 deletions
diff --git a/src/lib/gssapi/krb5/accept_sec_context.c b/src/lib/gssapi/krb5/accept_sec_context.c
index ed4c3e221..618b012f9 100644
--- a/src/lib/gssapi/krb5/accept_sec_context.c
+++ b/src/lib/gssapi/krb5/accept_sec_context.c
@@ -141,8 +141,10 @@ rd_and_store_for_creds(context, auth_context, inbuf, out_cred)
goto cleanup;
ccache = template_ccache; /* krb5_cc_gen_new will replace so make a copy */
- if ((retval = krb5_cc_gen_new(context, &ccache)))
+ if ((retval = krb5_cc_gen_new(context, &ccache))) {
+ ccache = NULL;
goto cleanup;
+ }
if ((retval = krb5_cc_initialize(context, ccache, creds[0]->client)))
goto cleanup;
diff --git a/src/lib/krb5/krb/vfy_increds.c b/src/lib/krb5/krb/vfy_increds.c
index 10a68f20d..39fb1f083 100644
--- a/src/lib/krb5/krb/vfy_increds.c
+++ b/src/lib/krb5/krb/vfy_increds.c
@@ -143,9 +143,10 @@ krb5_verify_init_creds(krb5_context context,
if ((ret = krb5_cc_resolve(context, "MEMORY:rd_req", &template_ccache)))
goto cleanup;
ccache = template_ccache; /* krb5_cc_gen_new will replace so make a copy */
-
- if ((ret = krb5_cc_gen_new(context, &ccache)))
- goto cleanup;
+ if ((ret = krb5_cc_gen_new(context, &ccache))) {
+ ccache = NULL;
+ goto cleanup;
+ }
if ((ret = krb5_cc_initialize(context, ccache, creds->client)))
goto cleanup;