From 400f0785e92866e5d8fd31ade6ae07a605d0df25 Mon Sep 17 00:00:00 2001
From: Daan De Meyer <daan.j.demeyer@gmail.com>
Date: Wed, 1 May 2024 03:14:45 +0200
Subject: [PATCH] core: Fix file descriptor leak

(cherry picked from commit 5bcf0881a322a72c38d518be3e3ae8bff95de5f6)
(cherry picked from commit 844bb02e48be98f4ae594e043c965588be3b138c)

Conflict:NA
Reference:https://github.com/systemd/systemd-stable/commit/400f0785e92866e5d8fd31ade6ae07a605d0df25
---
 src/core/service.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/service.c b/src/core/service.c
index f0763a59eb..e9466ed928 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -414,7 +414,7 @@ static void service_release_fd_store(Service *s) {
 static void service_release_stdio_fd(Service *s) {
         assert(s);
 
-        if (s->stdin_fd < 0 && s->stdout_fd < 0 && s->stdout_fd < 0)
+        if (s->stdin_fd < 0 && s->stdout_fd < 0 && s->stderr_fd < 0)
                 return;
 
         log_unit_debug(UNIT(s), "Releasing stdin/stdout/stderr file descriptors.");
-- 
2.33.0

