diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2017-10-12 16:42:46 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2017-10-13 13:10:57 +0200 |
commit | 4a76d4bd5dd73eaafcfcdc30bef1703e35383977 (patch) | |
tree | fbe2794c7484c53714e093e6ebf621e2a8306ca2 | |
parent | 1d4a2f8cf40f33425a9ea364a27ecc00528a0337 (diff) |
lib/tun.c: tun_ipv6_linklocal_get(): fix memory leak with getifaddrs()
From getifaddrs(3) man:
"The data returned by getifaddrs() is dynamically allocated and should
be freed using freeifaddrs() when no longer needed"
Change-Id: If6300d1c8d36fcafef294a4c11bbda31a158bb9c
-rw-r--r-- | lib/tun.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -776,7 +776,9 @@ int tun_ipv6_linklocal_get(const struct tun_t *tun, struct in6_addr *ia) continue; *ia = sin6->sin6_addr; + freeifaddrs(ifaddr); return 0; } + freeifaddrs(ifaddr); return -1; } |