Remove unreachable code as reported by Coverity (#527)

Coverity reported some code as unreachable.  A manual inspection confirmed the reports.

Fix By: Alexey A Tikhonov (@alexey-tikhonov)
pull/529/head
Alexey A Tikhonov 2 years ago committed by GitHub
parent 69950390b2
commit 903a613f9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/lib/ares__readaddrinfo.c
  2. 2
      src/lib/ares_getaddrinfo.c
  3. 3
      src/lib/ares_parse_uri_reply.c

@ -197,10 +197,6 @@ int ares__readaddrinfo(FILE *fp,
}
}
if (status != ARES_SUCCESS)
/* Ignore line if invalid address string for the requested family. */
continue;
if (want_cname)
{
for (i = 0; i < alias_count; ++i)

@ -825,7 +825,7 @@ static int as_is_first(const struct host_query* hquery)
char* p;
int ndots = 0;
size_t nname = hquery->name?strlen(hquery->name):0;
for (p = hquery->name; *p; p++)
for (p = hquery->name; p && *p; p++)
{
if (*p == '.')
{

@ -151,9 +151,6 @@ ares_parse_uri_reply (const unsigned char *abuf, int alen,
uri_curr->uri = strncpy(uri_curr->uri, (const char *)vptr, rr_len-4);
uri_curr->uri[rr_len-4]='\0';
uri_curr->ttl = rr_ttl;
if (status != ARES_SUCCESS)
break;
}
/* Don't lose memory in the next iteration */

Loading…
Cancel
Save