Re: [hackers] [slstatus][PATCH] ip: fixed memory leak

2018-05-20 Thread Aaron Marcher

Tobias,

thank you very much!

Cheers!
Aaron

--
Web: https://drkhsh.at/ or http://drkhsh5rv6pnahas.onion/
Gopher: gopher://drkhsh.at or gopher://drkhsh5rv6pnahas.onion
GPG: 0x7A65E38D55BE96FE
Fingerprint: 4688 907C 8720 3318 0D9F AFDE 7A65 E38D 55BE 96FE



[hackers] [slstatus][PATCH] ip: fixed memory leak

2018-05-20 Thread Tobias Tschinkowitz
free the interface list before returning from the function 

---
 components/ip.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/components/ip.c b/components/ip.c
index 0b6293e..468dc84 100644
--- a/components/ip.c
+++ b/components/ip.c
@@ -31,6 +31,7 @@ ip(const char *iface, unsigned short sa_family)
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;
-- 
2.16.2