From: Guus Sliepen Date: Fri, 30 Apr 2010 21:13:02 +0000 (+0200) Subject: Do not try to free NULL pointers. X-Git-Tag: release-1.1pre1~71 X-Git-Url: https://git.tinc-vpn.org/git/browse?a=commitdiff_plain;h=ee427cac0d04c60d09cc235c04664eab8b0c6527;p=tinc Do not try to free NULL pointers. --- diff --git a/src/net_setup.c b/src/net_setup.c index 593d8625..198da3df 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -465,7 +465,7 @@ bool setup_myself(void) { execute_script("tinc-up", envp); - for(i = 0; i < 5; i++) + for(i = 0; i < 4; i++) free(envp[i]); /* Run subnet-up scripts for our own subnets */ diff --git a/src/subnet.c b/src/subnet.c index dce57477..2d1f43a3 100644 --- a/src/subnet.c +++ b/src/subnet.c @@ -512,7 +512,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]); }