[krbdev.mit.edu #9016] [Comment] Memory leak in krb5_gss_inquire_cred

Greg Hudson via RT rt-comment at kerborg-prod-app-1.mit.edu
Fri Jul 16 12:13:09 EDT 2021


http://kerborg-prod-app-1.mit.edu/rt/Ticket/Display.html?id=9016
This is a comment.  It is not sent to the Requestor(s):

This bug was introduced in commit 1cd2821c19b2b95e39d5fc2f451a035585a40fa5
("Make gss-krb5 use cache collection").  In the previous code, cred could be
an owner pointer or a casted alias to cred_handle, and the default cred was
freed with "if (cred_handle == NULL) krb5_gss_release_cred(minor_status, &
cred)" along the success and failure paths.  The aforementioned commit cleans
this up by introducing defcred as the owner pointer for the obtained default
credential; however, it neglected to update the freeing code along the success
path.  Since the new code also reassigns cred_handle when obtaining a default
cred, the old code does not trigger and the default credential is not freed.

It looks like it should be possible to unify the success and failure paths,
and I may do that rather than make the trivial fix.
 



More information about the krb5-bugs mailing list