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 /driver.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 'driver.c')
-rw-r--r-- | driver.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -70,6 +70,8 @@ int batchcount; /* count of messages sent in current batch */ flag peek_capable; /* can we peek for better error recovery? */ int mailserver_socket_temp = -1; /* socket to free if connect timeout */ +struct addrinfo *ai0, *ai1; /* clean these up after signal */ + static volatile int timeoutcount = 0; /* count consecutive timeouts */ static volatile int idletimeout = 0; /* timeout occured in idle stage? */ @@ -878,6 +880,14 @@ static int do_session( sigfillset(&allsigs); sigprocmask(SIG_UNBLOCK, &allsigs, NULL); #endif /* HAVE_SIGPROCMASK */ + + if (ai0) { + freeaddrinfo(ai0); ai0 = NULL; + } + + if (ai1) { + freeaddrinfo(ai1); ai1 = NULL; + } if (js == THROW_SIGPIPE) { @@ -1053,7 +1063,7 @@ static int do_session( (void)sleep(1); if ((mailserver_socket = SockOpen(realhost, ctl->server.service ? ctl->server.service : ( ctl->use_ssl ? ctl->server.base_protocol->sslservice : ctl->server.base_protocol->service ), - ctl->server.plugin)) == -1) + ctl->server.plugin, &ai0)) == -1) { char errbuf[BUFSIZ]; int err_no = errno; |