ip: fixed memory leak free the interface list before returning from the function
Tobias Tschinkowitz he4d@posteo.de
Sun, 20 May 2018 15:53:48 +0200
1 files changed,
1 insertions(+),
0 deletions(-)
jump to
M
components/ip.c
→
components/ip.c
@@ -31,6 +31,7 @@ s = getnameinfo(ifa->ifa_addr, sizeof(struct sockaddr_in6),
host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST); if (!strcmp(ifa->ifa_name, iface) && (ifa->ifa_addr->sa_family == sa_family)) { + freeifaddrs(ifaddr); if (s != 0) { warn("getnameinfo: %s", gai_strerror(s)); return NULL;