calloc/malloc return value checking

Greg Hudson ghudson at MIT.EDU
Fri Apr 23 11:26:02 EDT 2010

On Fri, 2010-04-23 at 09:03 -0400, Jeff Blaine wrote:
> Just throwing this out there out of curiosity (learning).
> I'm seeing a lot of MIT krb5 code using:
>      blah = malloc(...);  /* or calloc() */
>      if (blah == 0)
> Is there an aversion to 'NULL' for some reason?

NULL is currently preferred, per:

We have an old code base which didn't have strong coding standards for
most of its lifetime; there was likely a developer or two who didn't
like using NULL.

More information about the krbdev mailing list