diff options
author | Matthias Andree <matthias.andree@gmx.de> | 2006-08-07 08:38:52 +0000 |
---|---|---|
committer | Matthias Andree <matthias.andree@gmx.de> | 2006-08-07 08:38:52 +0000 |
commit | c37b5d80dcbc0b30427ac7671b9eccd8856b1579 (patch) | |
tree | fce7689e312b4747523da39ab5975dc0d90b6bb0 /checkalias.c | |
parent | 00428859b66df7161ee4a0d3f55afaa03aa7a2c3 (diff) | |
download | fetchmail-c37b5d80dcbc0b30427ac7671b9eccd8856b1579.tar.gz fetchmail-c37b5d80dcbc0b30427ac7671b9eccd8856b1579.tar.bz2 fetchmail-c37b5d80dcbc0b30427ac7671b9eccd8856b1579.zip |
Freeaddrinfo() fix for Uli Zappe's bug.
This might fix Debian Bug#294547 and Bug#377135.
svn path=/branches/BRANCH_6-3/; revision=4880
Diffstat (limited to 'checkalias.c')
-rw-r--r-- | checkalias.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/checkalias.c b/checkalias.c index 8214b40a..1f0495b9 100644 --- a/checkalias.c +++ b/checkalias.c @@ -83,14 +83,14 @@ found: return rc; } -int is_host_alias(const char *name, struct query *ctl) +int is_host_alias(const char *name, struct query *ctl, struct addrinfo **res) /* determine whether name is a DNS alias of the mailserver for this query */ { struct mxentry *mxp, *mxrecords; struct idlist *idl; size_t namelen; int e; - struct addrinfo hints, *res, *res_st; + struct addrinfo hints, *res_st; struct hostdata *lead_server = ctl->server.lead_server ? ctl->server.lead_server : &ctl->server; @@ -160,11 +160,11 @@ int is_host_alias(const char *name, struct query *ctl) hints.ai_socktype=SOCK_STREAM; hints.ai_flags=AI_CANONNAME; - e = getaddrinfo(name, NULL, &hints, &res); + e = getaddrinfo(name, NULL, &hints, res); if (e == 0) { - int rr = (strcasecmp(ctl->server.truename, res->ai_canonname) == 0); - freeaddrinfo(res); + int rr = (strcasecmp(ctl->server.truename, (*res)->ai_canonname) == 0); + freeaddrinfo(*res); *res = NULL; if (rr) goto match; else if (ctl->server.checkalias && 0 == getaddrinfo(ctl->server.truename, NULL, &hints, &res_st)) |