packages/net/rtorrent/patches/010-fix_exec_capture_leak.patch

15 lines
566 B
Diff
Raw Normal View History

# Fixes a file handle leak in the execute_capture functions.
Index: rtorrent/src/rpc/exec_file.cc
===================================================================
--- rtorrent/src/rpc/exec_file.cc (revision 1093)
+++ rtorrent/src/rpc/exec_file.cc (working copy)
@@ -123,6 +123,8 @@
m_capture += std::string(buffer, length);
} while (length > 0);
+ ::close(pipeFd[0]);
+
if (m_logFd != -1) {
write(m_logFd, "Captured output:\n", sizeof("Captured output:\n"));
write(m_logFd, m_capture.data(), m_capture.length());