The 'port' buffer is passed to 'getnameinfo' which is supposed to fill
it but it's not actually later used. Drop the buffer as 'getnameinfo'
allows NULL arguments if they are not needed.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
socklen_t salen;
void *address = *addrList;
char host[NI_MAXHOST];
- char port[NI_MAXSERV];
if (resolved.h_addrtype == AF_INET) {
sa.sin.sin_family = AF_INET;
if ((err = getnameinfo(&sa.sa, salen,
host, sizeof(host),
- port, sizeof(port),
+ NULL, 0,
NI_NUMERICHOST | NI_NUMERICSERV)) != 0) {
ERROR("Cannot convert socket address to string: %s",
gai_strerror(err));