summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2003-12-30 19:54:24 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2003-12-30 19:54:24 +0000
commit734763169e94ae457cd653755000ed4aa04b5a42 (patch)
tree35e3090d1df4c8ffd8712d45c6a5d7069aa31010 /usr.sbin
parent6176ba98b1cd210011621f2a86f8f788b16f5f54 (diff)
we should not access ressources in a peer strcut 2 lines after we
detected a closed connection which caused an fsm call which causes a deallocation of said ressources (that was long for "missing return")
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bgpd/session.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c
index a8cca1c54b0..c979b76bcc9 100644
--- a/usr.sbin/bgpd/session.c
+++ b/usr.sbin/bgpd/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.50 2003/12/30 13:06:00 henning Exp $ */
+/* $OpenBSD: session.c,v 1.51 2003/12/30 19:54:23 henning Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
@@ -969,8 +969,10 @@ session_dispatch_msg(struct pollfd *pfd, struct peer *peer)
}
return (1);
}
- if (n == 0) /* connection closed */
+ if (n == 0) { /* connection closed */
bgp_fsm(peer, EVNT_CON_CLOSED);
+ return (1);
+ }
rpos = 0;
av = peer->rbuf->wpos + n;