svn rev #23363: trunk/src/lib/krb5/krb/

ghudson@MIT.EDU ghudson at MIT.EDU
Thu Nov 26 18:23:11 EST 2009


http://src.mit.edu/fisheye/changelog/krb5/?cs=23363
Commit By: ghudson
Log Message:
Clean up a few cases where krb5_get_in_tkt_with_keytab would leak the
options structure.



Changed Files:
U   trunk/src/lib/krb5/krb/gic_keytab.c
Modified: trunk/src/lib/krb5/krb/gic_keytab.c
===================================================================
--- trunk/src/lib/krb5/krb/gic_keytab.c	2009-11-26 09:05:17 UTC (rev 23362)
+++ trunk/src/lib/krb5/krb/gic_keytab.c	2009-11-26 23:23:11 UTC (rev 23363)
@@ -186,7 +186,7 @@
     if (arg_keytab == NULL) {
         retval = krb5_kt_default(context, &keytab);
         if (retval)
-            return retval;
+            goto cleanup;
     }
     else keytab = arg_keytab;
 
@@ -201,7 +201,6 @@
                                     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 @@
     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;
 }




More information about the cvs-krb5 mailing list