Fix memory leaks triggered by integration tests.
[tinc] / src / conf.c
index 4fcf82d..4dd016c 100644 (file)
@@ -4,7 +4,7 @@
                   1998-2005 Ivo Timmermans
                   2000      Cris van Pelt
                   2010-2011 Julien Muchembled <jm@jmuchemb.eu>
-                  2000-2015 Guus Sliepen <guus@tinc-vpn.org>
+                  2000-2021 Guus Sliepen <guus@tinc-vpn.org>
                   2013      Florent Clairambault <florent@clairambault.fr>
 
     This program is free software; you can redistribute it and/or modify
@@ -35,7 +35,7 @@
 #include "utils.h"              /* for cp */
 #include "xalloc.h"
 
-splay_tree_t *config_tree;
+splay_tree_t *config_tree = NULL;
 
 int pinginterval = 0;           /* seconds between pings */
 int pingtimeout = 0;            /* seconds to wait for response */
@@ -206,7 +206,7 @@ bool get_config_subnet(const config_t *cfg, subnet_t **result) {
                return false;
        }
 
-       if (subnetcheck(subnet)) {
+       if(subnetcheck(subnet)) {
                *(*result = new_subnet()) = subnet;
                return true;
        }