aboutsummaryrefslogtreecommitdiff
path: root/ares
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-05-13 06:53:29 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-05-13 06:53:29 +0000
commit2b7727aad1f4ede816be1511e3e62211593fab0b (patch)
tree936531796b1ebb5dab356817e6a3e04ddb123a88 /ares
parentfd775454ca71ef4a70bfefde1e1789af359de9d1 (diff)
James Bursa's patch to avoid free(NULL) (mainly because the libcurl memdebug
system thinks free(NULL) is badness)
Diffstat (limited to 'ares')
-rw-r--r--ares/ares_init.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ares/ares_init.c b/ares/ares_init.c
index 09062ac80..19c3eb26b 100644
--- a/ares/ares_init.c
+++ b/ares/ares_init.c
@@ -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);
}