sure (without more coffee) that the assumption is incorrect, but it makes
the code gratuitously non-transparent.
Coverity Scan (CID:8)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2375
d4fa192b-c00b-0410-8231-
f00ffab90ce4
fprintf(stderr, "getaddrinfo(): %s\n", gai_strerror(ret));
return (0);
}
- for (res = res0, i = 0; res != NULL; res = res->ai_next)
- ++i;
+ XXXAN(res0);
+ for (res = res0, i = 0; res != NULL; res = res->ai_next, ++i)
+ /* nothing */ ;
+ if (i == 0) {
+ freeaddrinfo(res0);
+ return (0);
+ }
va = calloc(i, sizeof *va);
XXXAN(va);
*vap = va;