When using getaddrinfo(), memory is allocated which later needs to be
freed using freeaddrinfo().
From the manual:
int getaddrinfo(const char *node, const char *service,
const struct addrinfo *hints,
struct addrinfo **res);
void freeaddrinfo(struct addrinfo *res);
The freeaddrinfo() function frees the memory that was allocated
for the dynamically allocated linked list res.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
When using getaddrinfo(), memory is allocated which later needs to be
freed using freeaddrinfo().
From the manual:
for the dynamically allocated linked list res.
Related ticket as far as i see: https://trac.cppcheck.net/ticket/6994