Don't check for NULL-pointers before calling free().
[oweals/tinc.git] / src / subnet.c
index ab181945da15ade67dbf4cc9ae0ba4bfc751e9dc..dc30b01344dd0efce40920fda32ba93eaf099204 100644 (file)
@@ -627,13 +627,8 @@ void subnet_update(node_t *owner, subnet_t *subnet, bool up) {
                        }
 
                        // Prepare the SUBNET and WEIGHT variables
-                       if(envp[5]) {
-                               free(envp[5]);
-                       }
-
-                       if(envp[6]) {
-                               free(envp[6]);
-                       }
+                       free(envp[5]);
+                       free(envp[6]);
 
                        xasprintf(&envp[5], "SUBNET=%s", netstr);
                        xasprintf(&envp[6], "WEIGHT=%s", weight);