1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 15:48:49 -05:00

James Bursa's patch to avoid free(NULL) (mainly because the libcurl memdebug

system thinks free(NULL) is badness)
This commit is contained in:
Daniel Stenberg 2004-05-13 06:53:29 +00:00
parent fd775454ca
commit 2b7727aad1

View File

@ -101,13 +101,13 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
/* Something failed; clean up memory we may have allocated. */
if (channel->nservers != -1)
free(channel->servers);
if (channel->ndomains != -1)
if (channel->domains)
{
for (i = 0; i < channel->ndomains; i++)
free(channel->domains[i]);
free(channel->domains);
}
if (channel->nsort != -1)
if (channel->sortlist)
free(channel->sortlist);
if(channel->lookups)
free(channel->lookups);
@ -454,7 +454,8 @@ DhcpNameServer
if (status != ARES_SUCCESS)
break;
}
free(line);
if(line)
free(line);
fclose(fp);
}