In krb5_kdcrep2creds, call the correct free function when cleaning up
authorGreg Hudson <ghudson@mit.edu>
Fri, 30 Jan 2009 21:21:10 +0000 (21:21 +0000)
committerGreg Hudson <ghudson@mit.edu>
Fri, 30 Jan 2009 21:21:10 +0000 (21:21 +0000)
the keyblock, and clean up the keyblock if krb5_copy_data fails.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21840 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/krb/gc_via_tkt.c

index 97e40bf3caf19935b28e0fb800d40968b214fdff..82972b7fc0ec8e0c5e59e6b0fa5334a72245fa2c 100644 (file)
@@ -55,7 +55,7 @@ krb5_kdcrep2creds(krb5_context context, krb5_kdc_rep *pkdcrep, krb5_address *con
         goto cleanup;
 
     if ((retval = krb5_copy_data(context, psectkt, &pdata)))
-       goto cleanup;
+       goto cleanup_keyblock;
     (*ppcreds)->second_ticket = *pdata;
     free(pdata);
 
@@ -85,7 +85,7 @@ krb5_kdcrep2creds(krb5_context context, krb5_kdc_rep *pkdcrep, krb5_address *con
     return 0;
 
 cleanup_keyblock:
-    krb5_free_keyblock(context, &(*ppcreds)->keyblock);
+    krb5_free_keyblock_contents(context, &(*ppcreds)->keyblock);
 
 cleanup:
     free (*ppcreds);