4 ms·
Please excuse my little experience with this topic, but when the article says this: > If this structure is dynamically allocated by gethostbyname() and returne
by severino 4y ago
Please excuse my little experience with this topic, but when the article says this:
> If this structure is dynamically allocated by gethostbyname() and returned to the caller, either you need an additional API function to free it or you have to commit to what fields in the structure have to be freed separately, and how
With your approach, wouldn't you need to free all the fields in the structure separately as well? Because, what's the difference between the library allocating the memory -with the problems the article points out- and allocating it yourself?