mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
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>
This commit is contained in:
committed by
Junio C Hamano
parent
71c7916053
commit
5861aa84a7
@@ -865,6 +865,7 @@ static int get_untracked_files(struct repository *r,
|
||||
}
|
||||
|
||||
strbuf_release(&buf);
|
||||
dir_clear(&dir);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user