]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix minor memory leaks in acquire_cred.c
authorGreg Hudson <ghudson@mit.edu>
Mon, 2 Jul 2012 17:21:04 +0000 (13:21 -0400)
committerGreg Hudson <ghudson@mit.edu>
Mon, 2 Jul 2012 18:13:20 +0000 (14:13 -0400)
src/lib/gssapi/krb5/acquire_cred.c

index 1972b1eb26661da4979271ded1799c4a33ecad9a..0527d13202a220569ed66f5ba2f84b364a9e1e65 100644 (file)
@@ -774,10 +774,8 @@ acquire_cred(OM_uint32 *minor_status, gss_name_t desired_name,
 
     if (name != NULL) {
         code = kg_duplicate_name(context, name, &cred->name);
-        if (code) {
-            *minor_status = code;
-            return GSS_S_FAILURE;
-        }
+        if (code)
+            goto krb_error_out;
     }
 
 #ifndef LEAN_CLIENT
@@ -834,6 +832,8 @@ error_out:
     if (cred != NULL) {
         if (cred->ccache)
             krb5_cc_close(context, cred->ccache);
+        if (cred->client_keytab)
+            krb5_kt_close(context, cred->client_keytab);
 #ifndef LEAN_CLIENT
         if (cred->keytab)
             krb5_kt_close(context, cred->keytab);