git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Fix resource leaks in various helpers and builtin commands
@ 2025-07-22  7:36 Hoyoung Lee
  2025-07-22  7:36 ` [PATCH 1/4] t/helper/test-truncate: close file descriptor after truncation Hoyoung Lee
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Hoyoung Lee @ 2025-07-22  7:36 UTC (permalink / raw)
  To: git; +Cc: Hoyoung Lee

This patch series fixes several cases where file descriptors were not
properly closed on error paths. The changes affect helper programs and
a builtin command, and ensure that system resources are correctly
released before returning from the function.

Each fix is minimal and follows the existing style of the surrounding
code. These changes help improve the robustness of the code by avoiding
potential file descriptor leaks.

Hoyoung Lee (4):
  t/helper/test-truncate: close file descriptor after truncation
  builtin/archive: close file descriptor on dup2() failure
  t/helper/test-delta: close fd if fstat() fails after open()
  t/helper/test-delta: close fd if fstat() fails after second open()

 builtin/archive.c        | 1 +
 t/helper/test-delta.c    | 3 +++
 t/helper/test-truncate.c | 3 +++
 3 files changed, 7 insertions(+)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 7+ messages in thread
* [PATCH 0/4] Fix resource leaks in various helpers and builtin commands
@ 2025-07-22  8:12 Hoyoung Lee
  2025-07-22  8:35 ` Jeff King
  0 siblings, 1 reply; 7+ messages in thread
From: Hoyoung Lee @ 2025-07-22  8:12 UTC (permalink / raw)
  To: git; +Cc: Hoyoung Lee

This patch series fixes several cases where file descriptors were not
properly closed on error paths. The changes affect helper programs and
a builtin command, and ensure that system resources are correctly
released before returning from the function.

Each fix is minimal and follows the existing style of the surrounding
code. These changes help improve the robustness of the code by avoiding
potential file descriptor leaks.

Hoyoung Lee (4):
  t/helper/test-truncate: close file descriptor after truncation
  builtin/archive: close file descriptor on dup2() failure
  t/helper/test-delta: close fd if fstat() fails after open()
  t/helper/test-delta: close fd if fstat() fails after second open()

 builtin/archive.c        | 4 +++-
 t/helper/test-delta.c    | 3 +++
 t/helper/test-truncate.c | 3 +++
 3 files changed, 9 insertions(+), 1 deletion(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-07-22  8:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-22  7:36 [PATCH 0/4] Fix resource leaks in various helpers and builtin commands Hoyoung Lee
2025-07-22  7:36 ` [PATCH 1/4] t/helper/test-truncate: close file descriptor after truncation Hoyoung Lee
2025-07-22  7:36 ` [PATCH 2/4] builtin/archive: close file descriptor on dup2() failure Hoyoung Lee
2025-07-22  7:36 ` [PATCH 3/4] t/helper/test-delta: close fd if fstat() fails after open() Hoyoung Lee
2025-07-22  7:36 ` [PATCH 4/4] t/helper/test-delta: close fd if fstat() fails after second open() Hoyoung Lee
  -- strict thread matches above, loose matches on Subject: below --
2025-07-22  8:12 [PATCH 0/4] Fix resource leaks in various helpers and builtin commands Hoyoung Lee
2025-07-22  8:35 ` Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).