static analyzer warning from 48e8cd2

Fixes new issue from last commit.
v1.28
Brad House 7 months ago
parent 11855a65c4
commit 2d5203d360
  1. 7
      src/lib/ares_getnameinfo.c

@ -143,7 +143,7 @@ static void ares_getnameinfo_int(ares_channel_t *channel,
callback(arg, ARES_EBADFLAGS, 0, NULL, NULL); callback(arg, ARES_EBADFLAGS, 0, NULL, NULL);
return; return;
} }
if (salen == sizeof(struct sockaddr_in6)) { if (sa->sa_family == AF_INET6) {
ares_inet_ntop(AF_INET6, &addr6->sin6_addr, ipbuf, IPBUFSIZ); ares_inet_ntop(AF_INET6, &addr6->sin6_addr, ipbuf, IPBUFSIZ);
/* If the system supports scope IDs, use it */ /* If the system supports scope IDs, use it */
#ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID #ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID
@ -159,9 +159,8 @@ static void ares_getnameinfo_int(ares_channel_t *channel,
} }
callback(arg, ARES_SUCCESS, 0, ipbuf, service); callback(arg, ARES_SUCCESS, 0, ipbuf, service);
return; return;
} } else {
/* This is where a DNS lookup becomes necessary */ /* This is where a DNS lookup becomes necessary */
else {
niquery = ares_malloc(sizeof(struct nameinfo_query)); niquery = ares_malloc(sizeof(struct nameinfo_query));
if (!niquery) { if (!niquery) {
callback(arg, ARES_ENOMEM, 0, NULL, NULL); callback(arg, ARES_ENOMEM, 0, NULL, NULL);

Loading…
Cancel
Save