From feea656d767066c031af6e4cf6854cbdad2a0c24 Mon Sep 17 00:00:00 2001 From: xy0 Date: Fri, 1 Apr 2022 16:53:06 +0800 Subject: [PATCH] iter_task:fix potential fd leak --- deps/oblib/src/lib/signal/ob_signal_worker.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/deps/oblib/src/lib/signal/ob_signal_worker.cpp b/deps/oblib/src/lib/signal/ob_signal_worker.cpp index 3990905138..1f4eafbf51 100644 --- a/deps/oblib/src/lib/signal/ob_signal_worker.cpp +++ b/deps/oblib/src/lib/signal/ob_signal_worker.cpp @@ -103,6 +103,9 @@ void iter_task(task_cb cb, void *data1, void *data2, int64_t exclude_tid) char d_name[]; }; int fd = ::open("/proc/self/task/", O_DIRECTORY | O_RDONLY); + DEFER( + CLOSE(fd); + ); if (-1 == fd) { } else { int tgid = getpid(); -- GitLab