X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fsubnet.c;h=2c67dcc1c07115798f89c7963a4854a609c62f23;hb=3fba80174dbe29bcfe0d121a2a1d2e61be5ee57b;hp=b96abfb5720fc5b4e2471b7d80345c64b1423d20;hpb=f4010694b3b16453e5e6298c208910264e326978;p=tinc diff --git a/src/subnet.c b/src/subnet.c index b96abfb5..2c67dcc1 100644 --- a/src/subnet.c +++ b/src/subnet.c @@ -452,7 +452,7 @@ subnet_t *lookup_subnet_ipv6(const ipv6_t *address) { void subnet_update(node_t *owner, subnet_t *subnet, bool up) { splay_node_t *node; int i; - char *envp[9] = {0}; + char *envp[9] = {NULL}; char netstr[MAXNETSTR]; char *name, *address, *port; char empty[] = ""; @@ -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(port); + free(address); } name = up ? "subnet-up" : "subnet-down";