summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2005-03-28 15:03:34 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2005-03-28 15:03:34 +0000
commit39a9e425075971f0ea56cca7ccac92c64b8f8a8e (patch)
tree076934ea967a67637d648e6b628116353a3444dc /usr.sbin
parent542f6cafd3234a53a4fed511e94902355ec9792c (diff)
free rules_l if the initial config file parse fails
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bgpd/Makefile4
-rw-r--r--usr.sbin/bgpd/bgpd.c6
-rw-r--r--usr.sbin/bgpd/bgpd.h4
-rw-r--r--usr.sbin/bgpd/rde.c4
-rw-r--r--usr.sbin/bgpd/session.c4
5 files changed, 13 insertions, 9 deletions
diff --git a/usr.sbin/bgpd/Makefile b/usr.sbin/bgpd/Makefile
index 83ddc5d5e63..0d4b9127b5c 100644
--- a/usr.sbin/bgpd/Makefile
+++ b/usr.sbin/bgpd/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.20 2004/11/11 16:59:47 claudio Exp $
+# $OpenBSD: Makefile,v 1.21 2005/03/28 15:03:33 henning Exp $
.PATH: ${.CURDIR}/..
@@ -6,7 +6,7 @@ PROG= bgpd
SRCS= bgpd.c buffer.c session.c log.c parse.y config.c imsg.c \
rde.c rde_rib.c rde_decide.c rde_prefix.c mrt.c kroute.c \
control.c pfkey.c rde_update.c rde_attr.c printconf.c \
- rde_filter.c pftable.c
+ rde_filter.c pftable.c leak.c
CFLAGS+= -Wall -I${.CURDIR}
CFLAGS+= -Wstrict-prototypes -Wmissing-prototypes
CFLAGS+= -Wmissing-declarations
diff --git a/usr.sbin/bgpd/bgpd.c b/usr.sbin/bgpd/bgpd.c
index 062333387f6..aa1172540dc 100644
--- a/usr.sbin/bgpd/bgpd.c
+++ b/usr.sbin/bgpd/bgpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpd.c,v 1.114 2005/03/24 02:39:16 tedu Exp $ */
+/* $OpenBSD: bgpd.c,v 1.115 2005/03/28 15:03:33 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -153,8 +153,10 @@ main(int argc, char *argv[])
}
}
- if (parse_config(conffile, &conf, &mrt_l, &peer_l, &net_l, rules_l))
+ if (parse_config(conffile, &conf, &mrt_l, &peer_l, &net_l, rules_l)) {
+ free(rules_l);
exit(1);
+ }
if (conf.opts & BGPD_OPT_NOACTION) {
if (conf.opts & BGPD_OPT_VERBOSE)
diff --git a/usr.sbin/bgpd/bgpd.h b/usr.sbin/bgpd/bgpd.h
index ca6c0e412ba..71d30dafd14 100644
--- a/usr.sbin/bgpd/bgpd.h
+++ b/usr.sbin/bgpd/bgpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpd.h,v 1.160 2005/03/23 10:46:26 henning Exp $ */
+/* $OpenBSD: bgpd.h,v 1.161 2005/03/28 15:03:33 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -29,6 +29,8 @@
#include <poll.h>
#include <stdarg.h>
+#include <leak.h>
+
#define BGP_VERSION 4
#define BGP_PORT 179
#define CONFFILE "/etc/bgpd.conf"
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c
index 687e61683f0..3ecab00cc06 100644
--- a/usr.sbin/bgpd/rde.c
+++ b/usr.sbin/bgpd/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.154 2005/03/24 10:28:39 henning Exp $ */
+/* $OpenBSD: rde.c,v 1.155 2005/03/28 15:03:33 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -264,7 +264,7 @@ rde_main(struct bgpd_config *config, struct peer *peer_l,
free(ibuf_main);
log_info("route decision engine exiting");
- _exit(0);
+ exit(0);
}
struct network_config netconf_s, netconf_p;
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c
index 6fa3eb0923b..a4cca553914 100644
--- a/usr.sbin/bgpd/session.c
+++ b/usr.sbin/bgpd/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.213 2005/03/11 17:46:11 henning Exp $ */
+/* $OpenBSD: session.c,v 1.214 2005/03/28 15:03:33 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -518,7 +518,7 @@ session_main(struct bgpd_config *config, struct peer *cpeers,
control_shutdown();
log_info("session engine exiting");
- _exit(0);
+ exit(0);
}
void