Fix two small memory leaks.
authorGuus Sliepen <guus@tinc-vpn.org>
Sun, 23 Sep 2018 13:48:54 +0000 (15:48 +0200)
committerGuus Sliepen <guus@tinc-vpn.org>
Sun, 23 Sep 2018 15:19:59 +0000 (17:19 +0200)
Found by valgrind.

src/dummy_device.c
src/subnet.c

index 4b01072368c13334f884530a1fef01fec273234f..d1d751beaa2dff60ea26d1f72ab1d747b1bd5864 100644 (file)
@@ -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) {
index 81dae5f3a6b6a0f257e3011036d01015915320ed..ab181945da15ade67dbf4cc9ae0ba4bfc751e9dc 100644 (file)
@@ -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]);
        }
 }