From 863dbc940e48d90238c9b184dce81b2dd6b23800 Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Sun, 14 Sep 2014 09:26:33 +0000 Subject: [PATCH] Fix descriptors leak. PR: bin/191002 Reported by: Ryan Steinmetz Submitted by: mjg --- 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 e98ed1e74480..0f531cc22d0d 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");