From: Todd C. Miller Date: Mon, 22 Jan 2018 17:27:16 +0000 (-0700) Subject: Add some missing freeaddrinfo() calls to avoid leaking memory. X-Git-Tag: release-1.1pre16~30 X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=commitdiff_plain;h=92d66492e0824674f68d26e787dd1ba4444a4601 Add some missing freeaddrinfo() calls to avoid leaking memory. --- diff --git a/src/invitation.c b/src/invitation.c index c667a6ed..4a262a82 100644 --- a/src/invitation.c +++ b/src/invitation.c @@ -1201,6 +1201,7 @@ next: aip = aip->ai_next; if(!aip) { + freeaddrinfo(ai); return 1; } } @@ -1246,6 +1247,8 @@ next: goto next; } + freeaddrinfo(ai); + // Check if the hash of the key he gave us matches the hash in the URL. char *fingerprint = line + 2; char hishash[64]; diff --git a/src/net_setup.c b/src/net_setup.c index 4f9d738f..17675aec 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -902,6 +902,7 @@ static bool setup_myself(void) { free(myport); memcpy(&sa, ai->ai_addr, ai->ai_addrlen); + freeaddrinfo(ai); sockaddr2str(&sa, NULL, &myport); }