diff options
author | Daniel Stenberg <daniel@haxx.se> | 2004-05-13 06:53:29 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2004-05-13 06:53:29 +0000 |
commit | 44f76e6a273936c171bfbe3927a3aeff18d606a3 (patch) | |
tree | 3f2ffa94cd6294c8a32a2d31e1f72870cdf747f3 | |
parent | 30f3594a7a9a1b4fb82dac7f8d3ebfdee469d46a (diff) | |
download | c-ares-44f76e6a273936c171bfbe3927a3aeff18d606a3.tar.gz c-ares-44f76e6a273936c171bfbe3927a3aeff18d606a3.tar.bz2 c-ares-44f76e6a273936c171bfbe3927a3aeff18d606a3.zip |
James Bursa's patch to avoid free(NULL) (mainly because the libcurl memdebug
system thinks free(NULL) is badness)
-rw-r--r-- | ares_init.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ares_init.c b/ares_init.c index 09062ac..19c3eb2 100644 --- a/ares_init.c +++ b/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); } |