Use free_known_addresses() to free memory allocated by get_known_addresses().
authorGuus Sliepen <guus@tinc-vpn.org>
Tue, 7 Mar 2017 18:19:19 +0000 (19:19 +0100)
committerGuus Sliepen <guus@tinc-vpn.org>
Tue, 7 Mar 2017 18:19:19 +0000 (19:19 +0100)
commit3fc678a8df4d6c057ef9f2c602b86ed106651e68
treebd0caf18601383b3647a982da3be3e9bbf9f41af
parentef661316f163f2ecf6c75a3dd28e2cad51772c56
Use free_known_addresses() to free memory allocated by get_known_addresses().

We know what struct addrinfo looks like, but the standard says nothing
about how it is allocated. So we cannot trust freeaddrinfo() to work
correctly on the struct addrinfo list we allocated ourselves in
get_known_addresses(). To make a distinction by allocations from the
latter and from str2addrinfo(), we keep two pointers (*ai and *kai) in
struct outgoing, and use the freeing function that is appropriate for
each.
src/net.h
src/net_socket.c