Skip to content

Commit 5861aa8

Browse files
rjustogitster
authored andcommitted
add-interactive: plug a leak in get_untracked_files
Plug a leak we have since ab1e1cc (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 71c7916 commit 5861aa8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

add-interactive.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,7 @@ static int get_untracked_files(struct repository *r,
865865
}
866866

867867
strbuf_release(&buf);
868+
dir_clear(&dir);
868869
return 0;
869870
}
870871

0 commit comments

Comments
 (0)