r18815@cathode-dark-space: raeburn | 2006-11-15 20:14:14 -0500
ticket: new
subject: avoid double frees in ccache manipulation around gen_new
target_version: 1.6
tags: pullup
* 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: 4774
version_fixed: 1.6
git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-6@18825
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;