From 020cc56a6dbe6635e3940953952fe8b05c1efa75 Mon Sep 17 00:00:00 2001 From: Max Schwarz Date: Wed, 16 Dec 2020 16:53:09 +0100 Subject: [PATCH] core: monitor: do not leak stderr file descriptors --- rosmon_core/src/monitor/node_monitor.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rosmon_core/src/monitor/node_monitor.cpp b/rosmon_core/src/monitor/node_monitor.cpp index e65c4e56..33802c19 100644 --- a/rosmon_core/src/monitor/node_monitor.cpp +++ b/rosmon_core/src/monitor/node_monitor.cpp @@ -407,6 +407,8 @@ void NodeMonitor::communicateStderr() handleByte('\n'); m_fdWatcher->removeFD(m_stderrFD); + close(m_stderrFD); + m_stderrFD = -1; return; // handled in communicate() }