git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3 0/2] fix resource leaks in test helpers

From
Hoyoung Lee <lhywkd22@gmail.com>
Date
Jul 22, 2025, 17:50 UTC
Message-ID
<20250722175009.2125844-1-lhywkd22@gmail.com>
Changes since v2:
- Dropped the second patch (`builtin/archive.c`) as discussed.
- Combined both resource leak fixes in `t/helper/test-delta.c` into a
  single patch using a unified cleanup path via `goto`.
- Ensured file descriptor is safely initialized and closed only when needed.
Thanks for the detailed and thoughtful reviews. Your comments helped me better understand how resource cleanup should be handled, especially when dealing with early program termination.
I especially appreciate your in-depth explanation regarding the difference between true resource leaks and stack-unwinding cases. The example you gave was very insightful, and it clarified how automated tools and reviewers should assess whether a resource is truly leaked. Thank you for taking the time to provide such a clear and instructive explanation.
Hoyoung Lee (2):
  t/helper/test-truncate: close file descriptor after truncation
  t/helper/test-delta: fix possible resource leak and ensure safe
    cleanup
 t/helper/test-delta.c    | 9 +++++----
 t/helper/test-truncate.c | 3 +++
 2 files changed, 8 insertions(+), 4 deletions(-)
-- 
2.34.1
Message 1 of 1 in “fix resource leaks in test helpers”
  1. 0/2 fix resource leaks in test helpersHoyoung Lee, Jul 22, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.