add-interactive: plug a leak in get_untracked_files
commit5861aa84a7a5f393e953203068bd3fc5c710fc42
authorRubén Justo <rjusto@gmail.com>
Mon, 22 Apr 2024 22:54:08 +0000 (23 00:54 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 22 Apr 2024 23:27:42 +0000 (22 16:27 -0700)
tree836384e2c4024974a701ae723a11b3918f8c464c
parent71c791605365d1873ef631bfc478fcd75080a063
add-interactive: plug a leak in get_untracked_files

Plug a leak we have since ab1e1cccaf (built-in add -i: re-implement
`add-untracked` in C, 2019-11-29).

This leak can be triggered with:

$ echo a | git add -i

As a curiosity, we have a somewhat similar function in builtin/stash.c,
which correctly frees the memory.

Signed-off-by: Rubén Justo <rjusto@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
add-interactive.c