can't free creds, it is passed in, but we can free the components
authorJohn Kohl <jtkohl@mit.edu>
Mon, 7 May 1990 17:13:52 +0000 (17:13 +0000)
committerJohn Kohl <jtkohl@mit.edu>
Mon, 7 May 1990 17:13:52 +0000 (17:13 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@764 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/ccache/file/fcc_nseq.c

index 8038ba6de9bd59c0d4739daebf42ceafb500632a..2826772b88683c10a1a993f47e1d86accc517294 100644 (file)
@@ -93,7 +93,19 @@ krb5_fcc_next_cred(id, cursor, creds)
          ((krb5_fcc_data *) id->data)->fd = -1;
      }
 lose:
-     if (kret != KRB5_OK)
-        krb5_free_creds(creds);
+     if (kret != KRB5_OK) {
+        if (creds->client)
+            krb5_free_principal(creds->client);
+        if (creds->server)
+            krb5_free_principal(creds->server);
+        if (creds->keyblock.contents)
+            xfree(creds->keyblock.contents);
+        if (creds->ticket.data)
+            xfree(creds->ticket.data);
+        if (creds->second_ticket.data)
+            xfree(creds->second_ticket.data);
+        if (creds->addresses)
+            krb5_free_address(creds->addresses);
+     }
      return kret;
 }