static void apply_enable_disable(queue *q, int enable);
static void init_syntax_tree(struct config_tree *);
-#ifdef DEBUG
+#ifdef FREE_CFG_T
static void free_auth_node(struct config_tree *);
static void free_config_other_modes(struct config_tree *);
void free_all_config_trees(void); /* atexit() */
static void free_config_tree(struct config_tree *ptree);
-#endif /* DEBUG */
+#endif /* FREE_CFG_T */
double *create_dval(double val);
void destroy_restrict_node(struct restrict_node *my_node);
* ----------------------------
*/
-#ifdef DEBUG
+#ifdef FREE_CFG_T
static void
free_auth_node(
struct config_tree *ptree
}
-#ifdef DEBUG
+#ifdef FREE_CFG_T
void
free_all_config_trees(void)
{
_CrtCheckMemory();
#endif
}
-#endif /* DEBUG */
+#endif /* FREE_CFG_T */
#ifdef SAVECONFIG
}
-#ifdef DEBUG
+#ifdef FREE_CFG_T
static void
free_config_other_modes(
struct config_tree *ptree
while (NULL != (addr_node = dequeue(ptree->multicastclient)))
destroy_address_node(addr_node);
}
-#endif /* DEBUG */
+#endif /* FREE_CFG_T */
static void
}
-#ifdef DEBUG
+#ifdef FREE_CFG_T
static void
free_config_auth(
struct config_tree *ptree
DESTROY_QUEUE(ptree->auth.trusted_key_list);
}
-#endif /* DEBUG */
+#endif /* FREE_CFG_T */
static void
}
-#ifdef DEBUG
+#ifdef FREE_CFG_T
static void
free_config_tos(
struct config_tree *ptree
free_node(tos);
}
}
-#endif /* DEBUG */
+#endif /* FREE_CFG_T */
static void
}
-#ifdef DEBUG
+#ifdef FREE_CFG_T
static void
free_config_monitor(
struct config_tree *ptree
free_node(my_node);
}
}
-#endif /* DEBUG */
+#endif /* FREE_CFG_T */
static void
}
-#ifdef DEBUG
+#ifdef FREE_CFG_T
static void
free_config_access(
struct config_tree *ptree
destroy_restrict_node(my_node);
}
}
-#endif /* DEBUG */
+#endif /* FREE_CFG_T */
static void
}
-#ifdef DEBUG
+#ifdef FREE_CFG_T
static void
free_config_tinker(
struct config_tree *ptree
while (NULL != (tinker = dequeue(ptree->tinker)))
free_node(tinker);
}
-#endif /* DEBUG */
+#endif /* FREE_CFG_T */
/*
}
-#ifdef DEBUG
+#ifdef FREE_CFG_T
static void
free_config_nic_rules(
struct config_tree *ptree
}
DESTROY_QUEUE(ptree->nic_rules);
}
-#endif /* DEBUG */
+#endif /* FREE_CFG_T */
static void
}
-#ifdef DEBUG
+#ifdef FREE_CFG_T
static void
free_config_system_opts(
struct config_tree *ptree
while (NULL != (flag = dequeue(ptree->disable_opts)))
free_node(flag);
}
-#endif /* DEBUG */
+#endif /* FREE_CFG_T */
static void
}
-#ifdef DEBUG
+#ifdef FREE_CFG_T
static void
free_config_logconfig(
struct config_tree *ptree
free_node(my_logconfig);
}
}
-#endif /* DEBUG */
+#endif /* FREE_CFG_T */
static void
}
-#ifdef DEBUG
+#ifdef FREE_CFG_T
static void
free_config_phone(
struct config_tree *ptree
free_node(s);
}
}
-#endif /* DEBUG */
+#endif /* FREE_CFG_T */
static void
}
-#ifdef DEBUG
+#ifdef FREE_CFG_T
static void
free_config_qos(
struct config_tree *ptree
free_node(my_qosconfig);
}
}
-#endif /* DEBUG */
+#endif /* FREE_CFG_T */
static void
}
-#ifdef DEBUG
+#ifdef FREE_CFG_T
static void
free_config_setvar(
struct config_tree *ptree
free_node(my_node);
}
}
-#endif /* DEBUG */
+#endif /* FREE_CFG_T */
static void
}
-#ifdef DEBUG
+#ifdef FREE_CFG_T
static void
free_config_ttl(
struct config_tree *ptree
{
/* coming DESTROY_QUEUE(ptree->ttl) is enough */
}
-#endif /* DEBUG */
+#endif /* FREE_CFG_T */
static void
}
-#ifdef DEBUG
+#ifdef FREE_CFG_T
static void
free_config_trap(
struct config_tree *ptree
free_node(curr_trap);
}
}
-#endif /* DEBUG */
+#endif /* FREE_CFG_T */
static void
}
-#ifdef DEBUG
+#ifdef FREE_CFG_T
static void
free_config_fudge(
struct config_tree *ptree
free_node(curr_fudge);
}
}
-#endif /* DEBUG */
+#endif /* FREE_CFG_T */
static void
}
-#ifdef DEBUG
+#ifdef FREE_CFG_T
static void
free_config_vars(
struct config_tree *ptree
free_node(curr_var);
}
}
-#endif /* DEBUG */
+#endif /* FREE_CFG_T */
/* Define a function to check if a resolved address is sane.
}
-#ifdef DEBUG
+#ifdef FREE_CFG_T
static void
free_config_peers(
struct config_tree *ptree
free_node(curr_peer);
}
}
-#endif /* DEBUG */
+#endif /* FREE_CFG_T */
static void
}
-#ifdef DEBUG
+#ifdef FREE_CFG_T
static void
free_config_unpeers(
struct config_tree *ptree
free_node(curr_unpeer);
}
}
-#endif /* DEBUG */
+#endif /* FREE_CFG_T */
#ifdef SIM
}
-#ifdef DEBUG
+#ifdef FREE_CFG_T
static void
free_config_sim(
struct config_tree *ptree
free_node(ptree->sim_details);
ptree->sim_details = NULL;
}
-#endif /* DEBUG */
+#endif /* FREE_CFG_T */
#endif /* SIM */
save_and_apply_config_tree(void)
{
struct config_tree *ptree;
+#ifndef SAVECONFIG
+ struct config_tree *punlinked;
+#endif
/*
* Keep all the configuration trees applied since startup in
#else
config_ntpdsim(ptree);
#endif
+
+ /*
+ * With configure --disable-saveconfig, there's no use keeping
+ * the config tree around after application, so free it.
+ */
+#ifndef SAVECONFIG
+ UNLINK_SLIST(punlinked, cfg_tree_history, ptree, link,
+ struct config_tree);
+ NTP_INSIST(punlinked == ptree);
+ free_config_tree(ptree);
+#endif
}