diff options
author | Rubén Justo <rjusto@gmail.com> | 2024-04-23 00:54:08 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-04-22 16:27:42 -0700 |
commit | 5861aa84a7a5f393e953203068bd3fc5c710fc42 (patch) | |
tree | 836384e2c4024974a701ae723a11b3918f8c464c | |
parent | 71c791605365d1873ef631bfc478fcd75080a063 (diff) | |
download | git-5861aa84a7a5f393e953203068bd3fc5c710fc42.tar.gz |
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>
-rw-r--r-- | add-interactive.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/add-interactive.c b/add-interactive.c index 6bf87e7ae7..e17602b5e4 100644 --- a/add-interactive.c +++ b/add-interactive.c @@ -865,6 +865,7 @@ static int get_untracked_files(struct repository *r, } strbuf_release(&buf); + dir_clear(&dir); return 0; } |