would be called on non-malloc'd memory (only would happen if you had more
than one entry in the server: line in mts.conf).
if (connect(sd, ai->ai_addr, ai->ai_addrlen) == 0) {
freeaddrinfo(res);
- client_freelist(ap);
+ client_freelist(arguments);
return sd;
}
freeaddrinfo(res);
}
- client_freelist(ap);
+ client_freelist(arguments);
strncpy (response, "no servers available", len_response);
return NOTOK;
}
static void
client_freelist(char **list)
{
- while (*list++ != NULL)
- free(*list);
+ free(*list);
}