All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/13] leak fixes for sparse-checkout code
@ 2024-05-31 11:24 Jeff King
  2024-05-31 11:25 ` [PATCH 01/13] sparse-checkout: free string list in write_cone_to_file() Jeff King
                   ` (14 more replies)
  0 siblings, 15 replies; 43+ messages in thread
From: Jeff King @ 2024-05-31 11:24 UTC (permalink / raw)
  To: git; +Cc: Patrick Steinhardt

So Patrick nerd-sniped me by asking if my earlier leakfix for git-mv was
triggered by the test suite. It was, in t7002, but that wasn't enough to
make the script leak-free. So I figured, how hard could it be to go all
the way?

Well. It only took a few patches (1-5), but in the process I stumbled on
a rather tricky interface oddity of add_pattern(), which caused some
other leaks. The interface is fixed in patch 6, and the matching leak
goes away in patch 7. Of course, I wanted to make sure it was tested, so
after poking around I found that t1091 triggered it.

But as you might guess, that didn't make t1091 leak-free. And I couldn't
bear leaving it on a cliffhanger like that, so patches 8-13 fix the rest
of the issues triggered by that script.

And along the way we managed to make t1090 and t3602 leak-free, too
(actually in patch 2, but I didn't notice until the whole thing was
done).

These should apply on top of jk/leakfixes, since the leak-freeness of
t7002 depends on the fix there.

  [01/13]: sparse-checkout: free string list in write_cone_to_file()
  [02/13]: sparse-checkout: pass string literals directly to add_pattern()
  [03/13]: dir.c: free strings in sparse cone pattern hashmaps
  [04/13]: sparse-checkout: clear patterns when init() sees existing sparse file
  [05/13]: dir.c: free removed sparse-pattern hashmap entries
  [06/13]: dir.c: always copy input to add_pattern()
  [07/13]: sparse-checkout: reuse --stdin buffer when reading patterns
  [08/13]: sparse-checkout: always free "line" strbuf after reading input
  [09/13]: sparse-checkout: refactor temporary sparse_checkout_patterns
  [10/13]: sparse-checkout: free sparse_filename after use
  [11/13]: sparse-checkout: free pattern list in sparse_checkout_list()
  [12/13]: sparse-checkout: free string list after displaying
  [13/13]: sparse-checkout: free duplicate hashmap entries

 builtin/sparse-checkout.c          | 49 +++++++++++++++++++-----------
 dir.c                              | 42 ++++++++++++++++---------
 dir.h                              |  3 +-
 t/t1090-sparse-checkout-scope.sh   |  1 +
 t/t1091-sparse-checkout-builtin.sh |  1 +
 t/t3602-rm-sparse-checkout.sh      |  1 +
 t/t7002-mv-sparse-checkout.sh      |  1 +
 7 files changed, 65 insertions(+), 33 deletions(-)

-Peff

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

end of thread, other threads:[~2024-06-05 16:52 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-31 11:24 [PATCH 0/13] leak fixes for sparse-checkout code Jeff King
2024-05-31 11:25 ` [PATCH 01/13] sparse-checkout: free string list in write_cone_to_file() Jeff King
2024-05-31 11:26 ` [PATCH 02/13] sparse-checkout: pass string literals directly to add_pattern() Jeff King
2024-05-31 16:14   ` Junio C Hamano
2024-06-04  9:43     ` Jeff King
2024-05-31 11:26 ` [PATCH 03/13] dir.c: free strings in sparse cone pattern hashmaps Jeff King
2024-05-31 11:27 ` [PATCH 04/13] sparse-checkout: clear patterns when init() sees existing sparse file Jeff King
2024-05-31 11:28 ` [PATCH 05/13] dir.c: free removed sparse-pattern hashmap entries Jeff King
2024-05-31 11:31 ` [PATCH 06/13] dir.c: always copy input to add_pattern() Jeff King
2024-05-31 22:28   ` Junio C Hamano
2024-05-31 11:31 ` [PATCH 07/13] sparse-checkout: reuse --stdin buffer when reading patterns Jeff King
2024-05-31 11:34 ` [PATCH 08/13] sparse-checkout: always free "line" strbuf after reading input Jeff King
2024-05-31 11:35 ` [PATCH 09/13] sparse-checkout: refactor temporary sparse_checkout_patterns Jeff King
2024-06-04  7:42   ` Patrick Steinhardt
2024-06-04  9:53     ` Jeff King
2024-05-31 11:35 ` [PATCH 10/13] sparse-checkout: free sparse_filename after use Jeff King
2024-06-04  7:42   ` Patrick Steinhardt
2024-06-04 10:01     ` Jeff King
2024-06-04 12:13       ` Patrick Steinhardt
2024-05-31 11:36 ` [PATCH 11/13] sparse-checkout: free pattern list in sparse_checkout_list() Jeff King
2024-05-31 11:36 ` [PATCH 12/13] sparse-checkout: free string list after displaying Jeff King
2024-05-31 11:38 ` [PATCH 13/13] sparse-checkout: free duplicate hashmap entries Jeff King
2024-06-04  7:43   ` Patrick Steinhardt
2024-05-31 11:49 ` [PATCH 0/13] leak fixes for sparse-checkout code Jeff King
2024-05-31 15:01   ` Junio C Hamano
2024-06-04 10:08 ` [PATCH v2 " Jeff King
2024-06-04 10:13   ` [PATCH v2 01/13] sparse-checkout: free string list in write_cone_to_file() Jeff King
2024-06-04 10:13   ` [PATCH v2 02/13] sparse-checkout: pass string literals directly to add_pattern() Jeff King
2024-06-04 10:13   ` [PATCH v2 03/13] dir.c: free strings in sparse cone pattern hashmaps Jeff King
2024-06-04 10:13   ` [PATCH v2 04/13] sparse-checkout: clear patterns when init() sees existing sparse file Jeff King
2024-06-04 10:13   ` [PATCH v2 05/13] dir.c: free removed sparse-pattern hashmap entries Jeff King
2024-06-04 10:13   ` [PATCH v2 06/13] dir.c: always copy input to add_pattern() Jeff King
2024-06-05  8:53     ` René Scharfe
2024-06-05  9:18       ` Jeff King
2024-06-05 16:52         ` Junio C Hamano
2024-06-04 10:13   ` [PATCH v2 07/13] sparse-checkout: reuse --stdin buffer when reading patterns Jeff King
2024-06-04 10:13   ` [PATCH v2 08/13] sparse-checkout: always free "line" strbuf after reading input Jeff King
2024-06-04 10:13   ` [PATCH v2 09/13] sparse-checkout: refactor temporary sparse_checkout_patterns Jeff King
2024-06-04 10:13   ` [PATCH v2 10/13] sparse-checkout: free sparse_filename after use Jeff King
2024-06-04 10:13   ` [PATCH v2 11/13] sparse-checkout: free pattern list in sparse_checkout_list() Jeff King
2024-06-04 10:13   ` [PATCH v2 12/13] sparse-checkout: free string list after displaying Jeff King
2024-06-04 10:13   ` [PATCH v2 13/13] sparse-checkout: free duplicate hashmap entries Jeff King
2024-06-04 12:15   ` [PATCH v2 0/13] leak fixes for sparse-checkout code Patrick Steinhardt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.