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-12 18:00:16 +0200 |
commit | 58c0da7833b87cd67aee78cc0159102d70f36be3 (patch) | |
tree | 6a90bc41ce71fa842058a325863fb0a3c2b14f16 /lib | |
parent | 958256f5cfd19610ecec8b1130f726b7a6bb17fc (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
Diffstat (limited to 'lib')
-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; } |