summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrenato <renato@openbsd.org>2016-05-23 16:39:47 +0000
committerrenato <renato@openbsd.org>2016-05-23 16:39:47 +0000
commiteee72fdddaf0f330d8260be46ee9a5317187366b (patch)
tree501ce8f61d8fb8493e4b2f76b7bda8ce3a93c64b
parentCheck for local label before trying to install pseudowire. (diff)
downloadwireguard-openbsd-eee72fdddaf0f330d8260be46ee9a5317187366b.tar.xz
wireguard-openbsd-eee72fdddaf0f330d8260be46ee9a5317187366b.zip
clear_config() should only deallocate memory and nothing else.
clear_config() is called when the parser fails (at startup or config reload). While cleaning up the allocated memory, the parser should not log anything, after all the daemon's running configuration is untouched. So, in this case, we se should clear the partial config by hand and avoid functions like if_del().
-rw-r--r--usr.sbin/ldpd/parse.y6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/ldpd/parse.y b/usr.sbin/ldpd/parse.y
index a771ab8f46a..36180d44107 100644
--- a/usr.sbin/ldpd/parse.y
+++ b/usr.sbin/ldpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.41 2016/05/23 16:35:37 renato Exp $ */
+/* $OpenBSD: parse.y,v 1.42 2016/05/23 16:39:47 renato Exp $ */
/*
* Copyright (c) 2004, 2005, 2008 Esben Norby <norby@openbsd.org>
@@ -1311,12 +1311,12 @@ clear_config(struct ldpd_conf *xconf)
while ((i = LIST_FIRST(&xconf->iface_list)) != NULL) {
LIST_REMOVE(i, entry);
- if_del(i);
+ free(i);
}
while ((t = LIST_FIRST(&xconf->tnbr_list)) != NULL) {
LIST_REMOVE(t, entry);
- tnbr_del(t);
+ free(t);
}
while ((n = LIST_FIRST(&xconf->nbrp_list)) != NULL) {