Skip to content

Commit 0f03f04

Browse files
newrengitster
authored andcommitted
sparse-checkout: fix a couple minor memory leaks
These were introduced in commit 55dfcf9 ("sparse-checkout: clear tracked sparse dirs", 2021-09-08) and missed in my review at the time. Plug the leaks. Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 55dfcf9 commit 0f03f04

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

builtin/sparse-checkout.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ static void clean_tracked_sparse_directories(struct repository *r)
182182
item->string);
183183
}
184184

185+
strvec_clear(&s);
186+
clear_pathspec(&p);
185187
dir_clear(&dir);
186188
}
187189

0 commit comments

Comments
 (0)