From 40789354a4fd0f28d4f1f9171ca9c1a24bac957f Mon Sep 17 00:00:00 2001 From: reyk Date: Wed, 16 Jul 2008 15:02:19 +0000 Subject: [PATCH] relay_connect() may fail, close the session in the bindany callback if it does. --- usr.sbin/relayd/relay.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.sbin/relayd/relay.c b/usr.sbin/relayd/relay.c index baa9f697972..21cbc69750e 100644 --- a/usr.sbin/relayd/relay.c +++ b/usr.sbin/relayd/relay.c @@ -1,4 +1,4 @@ -/* $OpenBSD: relay.c,v 1.93 2008/07/16 14:49:44 reyk Exp $ */ +/* $OpenBSD: relay.c,v 1.94 2008/07/16 15:02:19 reyk Exp $ */ /* * Copyright (c) 2006, 2007, 2008 Reyk Floeter @@ -2178,7 +2178,8 @@ relay_bindany(int fd, short event, void *arg) return; } - relay_connect((struct session *)con); + if (relay_connect((struct session *)con) == -1) + relay_close(con, "session failed"); } int -- 2.20.1