summaryrefslogtreecommitdiff
path: root/usr.sbin/ldapd/conn.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/ldapd/conn.c')
-rw-r--r--usr.sbin/ldapd/conn.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/ldapd/conn.c b/usr.sbin/ldapd/conn.c
index 0d3759d8f2d..f63c684e6c5 100644
--- a/usr.sbin/ldapd/conn.c
+++ b/usr.sbin/ldapd/conn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conn.c,v 1.19 2023/02/03 17:43:25 tb Exp $ */
+/* $OpenBSD: conn.c,v 1.20 2023/04/30 23:49:14 jsg Exp $ */
/*
* Copyright (c) 2009, 2010 Martin Hedenfalk <martin@bzero.se>
@@ -310,8 +310,10 @@ conn_accept(int fd, short event, void *data)
bufferevent_enable(conn->bev, EV_READ);
bufferevent_settimeout(conn->bev, 0, 60);
if (l->flags & F_LDAPS)
- if (conn_tls_init(conn) == -1)
+ if (conn_tls_init(conn) == -1) {
conn_close(conn);
+ goto giveup;
+ }
TAILQ_INIT(&conn->searches);
TAILQ_INSERT_HEAD(&conn_list, conn, next);