[PATCH] osmo-ggsn[master]: lib/tun.c: tun_ipv6_linklocal_get(): fix memory leak with ge...

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Thu Oct 12 16:00:24 UTC 2017


Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/4235

to look at the new patch set (#2).

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
---
M lib/tun.c
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/35/4235/2

diff --git a/lib/tun.c b/lib/tun.c
index 32a8d2d..35d371e 100644
--- a/lib/tun.c
+++ b/lib/tun.c
@@ -776,7 +776,9 @@
 			continue;
 
 		*ia = sin6->sin6_addr;
+		freeifaddrs(ifaddr);
 		return 0;
 	}
+	freeifaddrs(ifaddr);
 	return -1;
 }

-- 
To view, visit https://gerrit.osmocom.org/4235
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: If6300d1c8d36fcafef294a4c11bbda31a158bb9c
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder


More information about the gerrit-log mailing list