add: plug a leak on interactive_add
commit16727404c48ba1c2f43fb966276aee0b8cb24389
authorRubén Justo <rjusto@gmail.com>
Mon, 22 Apr 2024 22:54:18 +0000 (23 00:54 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 22 Apr 2024 23:27:43 +0000 (22 16:27 -0700)
tree0fe319b0d9e46c6950baf37995a321d83ccf37b5
parentec9b74b18e019a8adff827ab22380f9771ac5f00
add: plug a leak on interactive_add

Plug a leak we have since 5a76aff1a6 (add: convert to use
parse_pathspec, 2013-07-14).

This leak can be triggered with:
    $ git add -p anything

Fixing this leak allows us to mark as leak-free the following tests:

    + t3701-add-interactive.sh
    + t7514-commit-patch.sh

Mark them with "TEST_PASSES_SANITIZE_LEAK=true" to notice and fix
promply any new leak that may be introduced and triggered by them in the
future.

Signed-off-by: Rubén Justo <rjusto@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/add.c
t/t3701-add-interactive.sh
t/t7514-commit-patch.sh