* krb5/krb/vfy_increds.c (krb5_verify_init_creds): If krb5_cc_gen_new fails,
don't both close and destroy the template ccache.
* gssapi/krb5/accept_sec_context.c (rd_and_store_for_creds): Likewise.
ticket: new
target_version: 1.6
tags: pullup
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18815
dc483132-0cff-0310-8789-
dd5450dbe970
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;
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;