From: claudio Date: Tue, 11 May 2021 12:09:19 +0000 (+0000) Subject: Don't leak fd on error. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=d9aaae8aef970b11d0707432b3cabf7f1487c9f7;p=openbsd Don't leak fd on error. --- 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);