Page MenuHomeFreeBSD

Silently handle freeaddrinfo(NULL) for compatibility with code which works on other OSes.

Authored by kib on Sep 13 2017, 10:30 AM.



Also avoid unnecessary NULL check, free(NULL) is valid.

I did read But Linux accepts NULL and more and more code just expects this to work. It costs nothing to us, while removing another trip over the porting.

Diff Detail

rS FreeBSD src repository - subversion
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

hselasky added inline comments.
38 ↗(On Diff #33009)


This revision is now accepted and ready to land.Sep 13 2017, 10:39 AM

Capitalize start of sentence.

This revision now requires review to proceed.Sep 13 2017, 10:56 AM
bjk added inline comments.
364 ↗(On Diff #33011)

I would suggest something like:
The behavior of
.Li freeadrinfo(NULL)
is left unspecified by both
.St -susv4
.Dv "RFC 3493" .
The current implementation ignores a
argument for compatibility with programs that rely on the implementation
details of other operating systems.

A potential alternative to ".Li freeaddrinfo(NULL)" is "a .Dv NULL argument to .Nm" (with appropriate newlines).

bjk suggestion on the proper language.

kib marked an inline comment as done.Sep 14 2017, 1:35 PM
This revision is now accepted and ready to land.Sep 14 2017, 5:17 PM
This revision was automatically updated to reflect the committed changes.