From 4fb378497bd323a91b7062466cdd6ba645527b2f Mon Sep 17 00:00:00 2001 From: pjd Date: Thu, 18 Sep 2014 22:17:46 +0000 Subject: [PATCH] MFC r271577: Fix descriptors leak. PR: bin/191002 Reported by: Ryan Steinmetz Submitted by: mjg Approved by: re (gjb) git-svn-id: svn://svn.freebsd.org/base/stable/10@271844 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- contrib/openbsm/bin/auditdistd/subr.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/contrib/openbsm/bin/auditdistd/subr.c b/contrib/openbsm/bin/auditdistd/subr.c index e98ed1e74..0f531cc22 100644 --- a/contrib/openbsm/bin/auditdistd/subr.c +++ b/contrib/openbsm/bin/auditdistd/subr.c @@ -228,6 +228,11 @@ wait_for_file_init(int fd) PJDLOG_ASSERT(fd != -1); #ifdef HAVE_KQUEUE + if (wait_for_file_kq != -1) { + close(wait_for_file_kq); + wait_for_file_kq = -1; + } + kq = kqueue(); if (kq == -1) { pjdlog_errno(LOG_WARNING, "kqueue() failed"); -- 2.45.0