Skip to content

fix resource leaks in test helpers

Hoyoung Lee git 4 versions New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest posting 2/20 of 2 patches 0 repliesNew
  2. v3 posting 1/22 patches 12 repliesSuperseded
  3. v24 patches 6 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v14 patches0 repliesSuperseded

Changes in v3 from the cover letter

- 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.

Patches in v3 posting 2/2 No applies recorded yet

None of the 2 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

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

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(-)
Signature · 1 line
2.34.1