]> git.meshlink.io Git - meshlink/commit - src/net_socket.c
Use free_known_addresses() to free memory allocated by get_known_addresses().
authorGuus Sliepen <guus@meshlink.io>
Thu, 17 Dec 2015 17:44:21 +0000 (18:44 +0100)
committerGuus Sliepen <guus@meshlink.io>
Sun, 25 Jun 2017 08:51:52 +0000 (10:51 +0200)
commitaefe87865b47c80b415e2e01ca27b11b208b842d
treeb6f0908bfaca2ba4d27d3b13a8b3b3606de3d3ac
parentd90774f9eebb54dfb509b7005665a524cd0c3470
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 *aip) in struct outgoing, and use the freeing
function that is appropriate for each.
src/net.h
src/net_socket.c