From d9aaae8aef970b11d0707432b3cabf7f1487c9f7 Mon Sep 17 00:00:00 2001 From: claudio Date: Tue, 11 May 2021 12:09:19 +0000 Subject: [PATCH] Don't leak fd on error. --- usr.sbin/bgpd/rtr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.sbin/bgpd/rtr.c b/usr.sbin/bgpd/rtr.c index 576e60ce1b2..7ed317a4422 100644 --- a/usr.sbin/bgpd/rtr.c +++ b/usr.sbin/bgpd/rtr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtr.c,v 1.2 2021/04/26 07:40:26 claudio Exp $ */ +/* $OpenBSD: rtr.c,v 1.3 2021/05/11 12:09:19 claudio Exp $ */ /* * Copyright (c) 2020 Claudio Jeker @@ -214,6 +214,7 @@ rtr_dispatch_imsg_parent(struct imsgbuf *ibuf) if ((rs = rtr_get(imsg.hdr.peerid)) == NULL) { log_warnx("IMSG_SOCKET_CONN: unknown rtr id %d", imsg.hdr.peerid); + close(fd); break; } rtr_open(rs, fd); -- 2.20.1