mirror of
https://frontier.innolan.net/rainlance/c-ares.git
synced 2025-10-05 21:59:27 +00:00
ares_init.c: fix segfault triggered in ares_init_options() upon previous
failure of init_by_defaults() and incomplete cleanup there.
This commit is contained in:
13
ares_init.c
13
ares_init.c
@ -1249,15 +1249,22 @@ static int init_by_defaults(ares_channel channel)
|
||||
|
||||
error:
|
||||
if(rc) {
|
||||
if(channel->servers)
|
||||
if(channel->servers) {
|
||||
free(channel->servers);
|
||||
channel->servers = NULL;
|
||||
}
|
||||
|
||||
if(channel->domains && channel->domains[0])
|
||||
free(channel->domains[0]);
|
||||
if(channel->domains)
|
||||
if(channel->domains) {
|
||||
free(channel->domains);
|
||||
if(channel->lookups)
|
||||
channel->domains = NULL;
|
||||
}
|
||||
|
||||
if(channel->lookups) {
|
||||
free(channel->lookups);
|
||||
channel->lookups = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if(hostname)
|
||||
|
Reference in New Issue
Block a user