From: Guus Sliepen Date: Sun, 23 Sep 2018 13:48:54 +0000 (+0200) Subject: Fix two small memory leaks. X-Git-Tag: release-1.0.35~7 X-Git-Url: https://git.tinc-vpn.org/git/browse?a=commitdiff_plain;h=69f09a712cfd08650acca421506c6a9eb9984dd8;p=tinc Fix two small memory leaks. Found by valgrind. --- diff --git a/src/dummy_device.c b/src/dummy_device.c index 4b010723..d1d751be 100644 --- a/src/dummy_device.c +++ b/src/dummy_device.c @@ -37,6 +37,8 @@ static bool setup_device(void) { } static void close_device(void) { + free(device); + free(iface); } static bool read_packet(vpn_packet_t *packet) { diff --git a/src/subnet.c b/src/subnet.c index 81dae5f3..ab181945 100644 --- a/src/subnet.c +++ b/src/subnet.c @@ -659,7 +659,7 @@ void subnet_update(node_t *owner, subnet_t *subnet, bool up) { } } - for(i = 0; envp[i] && i < 9; i++) { + for(i = 0; i < 9; i++) { free(envp[i]); } }