sparse-checkout: fix a couple minor memory leaks
PATCH 1/1 sparse-checkout: fix a couple minor memory leaks
From: Elijah Newren <[email protected]>
These were introduced in commit 55dfcf9591 ("sparse-checkout: clear tracked sparse dirs", 2021-09-08) and missed in my review at the time. Plug the leaks.
---
sparse-checkout: fix a couple minor memory leaks
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1189%2Fnewren%2Fsparse-directory-cleaning-memleaks-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1189/newren/sparse-directory-cleaning-memleaks-v1
Pull-Request: https://github.com/git/git/pull/1189
builtin/sparse-checkout.c | 2 ++ 1 file changed, 2 insertions(+)
builtin/sparse-checkout.c +2 -0
@@ -185,6 +185,8 @@ static void clean_tracked_sparse_directories(struct repository *r) item->string); } +strvec_clear (&s); +clear_pathspec (&p);dir_clear (&dir); }
base-commit: 1ffcbaa1a5f10c9f706314d77f88de20a4a498c2
Signature · 1 line
gitgitgadget
Quoted 22 lines · Elijah Newren via GitGitGadget
From: Elijah Newren <[email protected]>
These were introduced in commit
55dfcf9591("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]>---
sparse-checkout: fix a couple minor memory leaksPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1189%2Fnewren%2Fsparse-directory-cleaning-memleaks-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1189/newren/sparse-directory-cleaning-memleaks-v1
Pull-Request: https://github.com/git/git/pull/1189builtin/sparse-checkout.c | 2 ++ 1 file changed, 2 insertions(+)builtin/sparse-checkout.c +0
-0
builtin/sparse-checkout.c static void clean_tracked_sparse_directories(struct repository *r) · line 191
Quoted 7 lines
builtin/sparse-checkout.c +2
-0@@ -185,6 +185,8 @@ static void clean_tracked_sparse_directories(struct repository *r) item->string); } +strvec_clear (&s); +clear_pathspec (&p);dir_clear (&dir); }
Simple enough. Thanks for catching and fixing this.
-Stolee