freeaddrinfo(NULL)

Valentin Nechayev netch at lucky.net
Wed Sep 22 01:07:30 PDT 2004


 Wed, Sep 22, 2004 at 05:07:13, jinmei wrote about "Re: freeaddrinfo(NULL)": 

> I was not talking about things like whether NULL had been specially
> designed or not.  I was basically talking about any invalid argument
> to freeaddrinfo.

Well, garbage in pointer is unquestionably invalid, but whether NULL is invalid
it's discussable (and flammable) question.
Initing pointer to NULL is popular method and it's reasonable to keep it
working without extra actions, as verifying !=NULL at freeing.

As this discussion has no common with -net questions, I propose to move
it to some another list.

> However, since the API
> specification is silent on this, I'd then request that the man page
> make an explicit note that the application programmer should be check
> if the argument to freeaddrinfo() is valid because passing a NULL
> pointer may cause an unexpected result, including segfaulting, on
> other systems.

Agreed.


-netch-


More information about the freebsd-net mailing list