Re: Style question: Should one check for NULL pointers?

Horst von Brand
2003-07-12T22:17:26Z

Alan Stern <stern@rowland.harvard.edu> said:

[...]

> But if you look very far through the kernel sources you will see many
> occurrences of code similar to this:
>
> static void release(struct xxx *ptr)
> {
> if (!ptr)
> return;
> ...
>
> I can't see any reason for keeping something like that.

Just like free(3)
--
Dr. Horst H. von Brand User #22616 counter.li.org
Departamento de Informatica Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria +56 32 654239
Casilla 110-V, Valparaiso, Chile Fax: +56 32 797513