From: Guus Sliepen Date: Mon, 22 Jan 2018 17:05:09 +0000 (+0100) Subject: Fix calling freeaddrinfo() on the wrong pointer. X-Git-Tag: release-1.1pre16~31 X-Git-Url: https://tinc-vpn.org/git/browse?a=commitdiff_plain;h=e0f6d90e7fac4c567900e98c354af979c97f8d59;p=tinc Fix calling freeaddrinfo() on the wrong pointer. Thanks to Todd C. Miller for finding this issue. --- diff --git a/src/address_cache.c b/src/address_cache.c index 552e1f28..42b671b8 100644 --- a/src/address_cache.c +++ b/src/address_cache.c @@ -178,8 +178,8 @@ const sockaddr_t *get_recent_address(address_cache_t *cache) { cache->aip = cache->aip->ai_next; if(!cache->aip) { - freeaddrinfo(cache->aip); - cache->aip = NULL; + freeaddrinfo(cache->ai); + cache->ai = cache->aip = NULL; } return sa;