From 1df0550c374c42b6493dc2f0e563a09c03b66968 Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Thu, 26 Nov 2009 23:23:11 +0000 Subject: [PATCH] Clean up a few cases where krb5_get_in_tkt_with_keytab would leak the options structure. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23363 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/krb/gic_keytab.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/krb5/krb/gic_keytab.c b/src/lib/krb5/krb/gic_keytab.c index 4bdf9ee1b..c4c6d3205 100644 --- a/src/lib/krb5/krb/gic_keytab.c +++ b/src/lib/krb5/krb/gic_keytab.c @@ -186,7 +186,7 @@ krb5_get_in_tkt_with_keytab(krb5_context context, krb5_flags options, if (arg_keytab == NULL) { retval = krb5_kt_default(context, &keytab); if (retval) - return retval; + goto cleanup; } else keytab = arg_keytab; @@ -201,7 +201,6 @@ krb5_get_in_tkt_with_keytab(krb5_context context, krb5_flags options, get_as_key_keytab, (void *)keytab, &use_master, ret_as_reply); krb5_free_unparsed_name( context, server); - krb5_get_init_creds_opt_free(context, opts); if (retval) { goto cleanup; } @@ -214,7 +213,9 @@ krb5_get_in_tkt_with_keytab(krb5_context context, krb5_flags options, if (ccache) if ((retval = krb5_cc_store_cred(context, ccache, creds))) goto cleanup; -cleanup: if (arg_keytab == NULL) +cleanup: + krb5_get_init_creds_opt_free(context, opts); + if (arg_keytab == NULL) krb5_kt_close(context, keytab); return retval; } -- 2.26.2