git/builtin
Ævar Arnfjörð Bjarmason 9f24f3c719 worktree: fix a trivial leak in prune_worktrees()
We were leaking both the "struct strbuf" in prune_worktrees(), as well
as the "path" we got from should_prune_worktree(). Since these were
the only two uses of the "struct string_list" let's change it to a
"DUP" and push these to it with "string_list_append_nodup()".

For the string_list_append_nodup() we could also string_list_append()
the main_path.buf, and then strbuf_release(&main_path) right away. But
doing it this way avoids an allocation, as we already have the "struct
strbuf" prepared for appending to "kept".

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-02-06 15:34:38 -08:00
..
2022-12-26 11:42:05 +09:00
2023-01-21 17:21:58 -08:00
2020-07-30 19:18:06 -07:00
2022-04-06 09:42:14 -07:00
2023-01-13 14:17:14 -08:00
2023-01-05 15:07:22 +09:00
2023-01-08 10:28:34 +09:00
2023-02-06 15:34:37 -08:00
2022-12-14 15:55:46 +09:00
2021-10-28 09:57:09 -07:00
2022-12-14 15:55:46 +09:00
2022-11-23 11:22:24 +09:00
2023-01-23 13:39:52 -08:00
2022-11-16 14:57:32 -05:00
2022-12-14 15:55:46 +09:00
2022-12-18 11:48:26 +09:00