diff options
author | Tobias Tschinkowitz <he4d@posteo.de> | 2018-05-20 15:53:48 +0200 |
---|---|---|
committer | Aaron Marcher <me@drkhsh.at> | 2018-05-20 22:06:54 +0200 |
commit | 1cd8a7b5109311e03fe9de2372c7adc483445db7 (patch) | |
tree | fe8bea2294c300816ba5c996d91419668c104e29 /components | |
parent | b640cc489b65153efcb519feb9038d658b4bf005 (diff) |
ip: fixed memory leak
free the interface list before returning from the function
Diffstat (limited to 'components')
-rw-r--r-- | components/ip.c | 1 |
1 files changed, 1 insertions, 0 deletions
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; |