From 50aba7ce08b89a4672c220b79d265650e37a9d27 Mon Sep 17 00:00:00 2001 From: jsg Date: Thu, 18 Aug 2016 00:45:52 +0000 Subject: [PATCH] fix fd leaks in error paths ok reyk@ --- usr.sbin/relayd/carp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.sbin/relayd/carp.c b/usr.sbin/relayd/carp.c index 09708aa7dbf..6a6a55a0fbb 100644 --- a/usr.sbin/relayd/carp.c +++ b/usr.sbin/relayd/carp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: carp.c,v 1.11 2015/01/22 17:42:09 reyk Exp $ */ +/* $OpenBSD: carp.c,v 1.12 2016/08/18 00:45:52 jsg Exp $ */ /* * Copyright (c) 2006 Henning Brauer @@ -117,6 +117,7 @@ carp_demote_get(char *group) if (strlcpy(ifgr.ifgr_name, group, sizeof(ifgr.ifgr_name)) >= sizeof(ifgr.ifgr_name)) { log_warn("%s: invalid group", __func__); + close(s); return (-1); } @@ -201,6 +202,7 @@ carp_demote_ioctl(char *group, int demote) if (strlcpy(ifgr.ifgr_name, group, sizeof(ifgr.ifgr_name)) >= sizeof(ifgr.ifgr_name)) { log_warn("%s: invalid group", __func__); + close(s); return (-1); } ifgr.ifgr_attrib.ifg_carp_demoted = demote; -- 2.20.1