Don't forget to remember previous element at the end of the loop.

Reported by:	brueffer
Found with:	Coverity Prevent(tm)
CID:		1135301
This commit is contained in:
pjd 2014-04-30 09:58:28 +00:00
parent c3b6e24c0c
commit 558b866a3a

View File

@ -247,6 +247,7 @@ cap_getaddrinfo(cap_channel_t *chan, const char *hostname, const char *servname,
prevai->ai_next = curai;
else if (firstai == NULL)
firstai = curai;
prevai = curai;
}
nvlist_destroy(nvl);
if (curai == NULL && nvlai != NULL) {