Free resources in rsa_t.
[tinc] / src / subnet.c
index dce5747..b8da092 100644 (file)
@@ -469,6 +469,8 @@ void subnet_update(node_t *owner, subnet_t *subnet, bool up) {
                // 4 and 5 are reserved for SUBNET and WEIGHT
                xasprintf(&envp[6], "REMOTEADDRESS=%s", address);
                xasprintf(&envp[7], "REMOTEPORT=%s", port);
+               free(address);
+               free(port);
        }
 
        name = up ? "subnet-up" : "subnet-down";
@@ -512,7 +514,7 @@ void subnet_update(node_t *owner, subnet_t *subnet, bool up) {
                }
        }
 
-       for(i = 0; envp[i] && i < 9; i++)
+       for(i = 0; envp[i] && i < 8; i++)
                free(envp[i]);
 }