Subject: [PATCH 0/4] plugging some mmap() leaks

From: Jeff King <[email-masked]>
Date: Thu, 5 Mar 2026 18:03:15 -0500

On Thu, Mar 05, 2026 at 05:02:14PM -0500, Jeff King wrote:

> Anyway, I think the solution is probably something like the patch above,
> though probably it needs to cover the case where new_pack is NULL.

So here is a more polished version. I decided to try running the whole
test suite with leak-checking and NO_MMAP, and it turned up one other
case. This series fixes that, too, and then turns on the flag for all
leak-checking builds.

  [1/4]: check_connected(): delay opening new_pack
  [2/4]: check_connected(): fix leak of pack-index mmap
  [3/4]: pack-revindex: avoid double-loading .rev files
  [4/4]: Makefile: turn on NO_MMAP when building with LSan

 Makefile        |  1 +
 connected.c     | 38 +++++++++++++++++++-------------------
 pack-revindex.c |  4 ++++
 3 files changed, 24 insertions(+), 19 deletions(-)

-Peff