summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/control.c
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2008-01-31 12:17:36 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2008-01-31 12:17:36 +0000
commit5b4dde59a0b228868613dcc5b164815ca83c085f (patch)
treed554c5f5ea0108c6beebe37dc9d2b22e3a2ac2cf /usr.sbin/bgpd/control.c
parentac20736c423a4be197e31b7d9daebbe9a4c511a5 (diff)
do not leak confd on malloc failure in control_accept()
found by Igor Zinovik <zinovik@cs.karelia.ru>
Diffstat (limited to 'usr.sbin/bgpd/control.c')
-rw-r--r--usr.sbin/bgpd/control.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/control.c b/usr.sbin/bgpd/control.c
index 9bbd6be1ecd..522564e175e 100644
--- a/usr.sbin/bgpd/control.c
+++ b/usr.sbin/bgpd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.57 2007/12/23 18:26:13 henning Exp $ */
+/* $OpenBSD: control.c,v 1.58 2008/01/31 12:17:35 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -131,6 +131,7 @@ control_accept(int listenfd, int restricted)
if ((ctl_conn = malloc(sizeof(struct ctl_conn))) == NULL) {
log_warn("session_control_accept");
+ close(connfd);
return (0);
}