For review: GSS memory allocation patch

Greg Hudson ghudson at MIT.EDU
Fri Oct 14 12:35:50 EDT 2011


On 10/14/2011 12:16 PM, Kevin Wasserman wrote:
> That all sounds reasonable to me, though personally I would argue
> that if the contract is to always completely destroy the data list,
> I would keep the extra indirection and set it to NULL before
> completion.

That practice is consistent with the GSSAPI but not with most krb5 code.
 Note that none of the krb5_free_foo functions take an extra layer of
indirection.

> Actually, previously, the list _elements_ were all
> destroyed, but not the list itself; would you actually prefer that
> behavior?

If I understand you, that's incorrect.  Prior to your recent change, the
list itself was completely destroyed on success, and left completely
alone on failure.

After everything is cleaned up, the list itself should be destroyed on
success or failure, since we cannot easily leave it completely alone on
failure.



More information about the krbdev mailing list