Browse Source

Fix two small memory leaks.

Found by valgrind.
Guus Sliepen 5 years ago
parent
commit
69f09a712c
2 changed files with 3 additions and 1 deletions
  1. 2 0
      src/dummy_device.c
  2. 1 1
      src/subnet.c

+ 2 - 0
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) {

+ 1 - 1
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]);
 	}
 }