Fix leak in fcc_remove_cred()

This commit is contained in:
Nicolas Williams
2015-03-23 17:44:21 -05:00
parent 333c6fe95d
commit 945fe5fb2f

View File

@@ -1041,8 +1041,10 @@ fcc_remove_cred(krb5_context context,
if (ret)
return ret;
while ((ret = krb5_cc_next_cred(context, id, &cursor, &found_cred)) == 0) {
if (!krb5_compare_creds(context, which, mcred, &found_cred))
if (!krb5_compare_creds(context, which, mcred, &found_cred)) {
krb5_free_cred_contents(context, &found_cred);
continue;
}
cred_delete(context, id, &cursor, &found_cred);
krb5_free_cred_contents(context, &found_cred);
}