diff options
author | 2016-05-23 16:58:31 +0000 | |
---|---|---|
committer | 2016-05-23 16:58:31 +0000 | |
commit | 897d52a1fd7ff39f1de4fb36d51e84c58dcfc4e0 (patch) | |
tree | 5642271baa80aa5ac4e1b10b95cc123c9483931b | |
parent | Rework L2VPN code. (diff) | |
download | wireguard-openbsd-897d52a1fd7ff39f1de4fb36d51e84c58dcfc4e0.tar.xz wireguard-openbsd-897d52a1fd7ff39f1de4fb36d51e84c58dcfc4e0.zip |
Fix fd leak in error path.
-rw-r--r-- | usr.sbin/ldpd/neighbor.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/ldpd/neighbor.c b/usr.sbin/ldpd/neighbor.c index 19d49c0fdbe..3fdc30b90e6 100644 --- a/usr.sbin/ldpd/neighbor.c +++ b/usr.sbin/ldpd/neighbor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: neighbor.c,v 1.63 2016/05/23 16:23:06 renato Exp $ */ +/* $OpenBSD: neighbor.c,v 1.64 2016/05/23 16:58:31 renato Exp $ */ /* * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> @@ -512,11 +512,13 @@ nbr_establish_connection(struct nbr *nbr) if (nbrp && nbrp->auth.method == AUTH_MD5SIG) { if (sysdep.no_pfkey || sysdep.no_md5sig) { log_warnx("md5sig configured but not available"); + close(nbr->fd); return (-1); } if (setsockopt(nbr->fd, IPPROTO_TCP, TCP_MD5SIG, &opt, sizeof(opt)) == -1) { log_warn("setsockopt md5sig"); + close(nbr->fd); return (-1); } } |