From: Leefancy Date: Mon, 10 Nov 2025 09:14:18 +0000 (+0800) Subject: Fix the issue of fd resource leakage X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c305d73eebc11279e8e85454b58a3f4d7c36874d;p=thirdparty%2Futil-linux.git Fix the issue of fd resource leakage Signed-off-by: Leefancy --- diff --git a/misc-utils/kill.c b/misc-utils/kill.c index b522bcb20..df83548f6 100644 --- a/misc-utils/kill.c +++ b/misc-utils/kill.c @@ -612,6 +612,8 @@ static int kill_verbose(const struct kill_control *ctl) rc = pidfd_send_signal(pfd, ctl->numsig, 0, 0); if (rc < 0) err(EXIT_FAILURE, _("pidfd_send_signal() failed")); + + close(pfd); } else #endif rc = kill(ctl->pid, ctl->numsig);