1
0
mirror of https://frontier.innolan.net/rainlance/c-ares.git synced 2025-10-06 02:59:37 +00:00

Don't exit loop early leaving uninitialized entries

Update for commit affc63cba8.

The original patch from Gregor Jasny did not have the break
statement; I incorrectly added it to prevent continuing the loop.
However, the later entries in the array would then be left
uninitialized, causing problems for later cleanup.

So fix to match Gregor's original patch, with apologies.
This commit is contained in:
David Drysdale
2016-01-18 09:30:25 +00:00
parent c49a87eea5
commit 66f40230a0

View File

@ -1205,10 +1205,8 @@ static int init_by_resolv_conf(ares_channel channel)
channel->ndomains = entries;
for (int i = 0; i < channel->ndomains; ++i) {
channel->domains[i] = strdup(res.dnsrch[i]);
if (!channel->domains[i]) {
if (!channel->domains[i])
status = ARES_ENOMEM;
break;
}
}
}
}