git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] sparse-checkout: fix a couple minor memory leaks
@ 2022-01-28  1:58 Elijah Newren via GitGitGadget
  2022-01-28 15:04 ` Derrick Stolee
  0 siblings, 1 reply; 2+ messages in thread
From: Elijah Newren via GitGitGadget @ 2022-01-28  1:58 UTC (permalink / raw)
  To: git
  Cc: Derrick Stolee, Victoria Dye, Lessley Dennington, Elijah Newren,
	Elijah Newren

From: Elijah Newren <newren@gmail.com>

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 <newren@gmail.com>
---
    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(+)

diff --git a/builtin/sparse-checkout.c b/builtin/sparse-checkout.c
index 679c1070368..c655517e019 100644
--- a/builtin/sparse-checkout.c
+++ b/builtin/sparse-checkout.c
@@ -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
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] sparse-checkout: fix a couple minor memory leaks
  2022-01-28  1:58 [PATCH] sparse-checkout: fix a couple minor memory leaks Elijah Newren via GitGitGadget
@ 2022-01-28 15:04 ` Derrick Stolee
  0 siblings, 0 replies; 2+ messages in thread
From: Derrick Stolee @ 2022-01-28 15:04 UTC (permalink / raw)
  To: Elijah Newren via GitGitGadget, git
  Cc: Victoria Dye, Lessley Dennington, Elijah Newren

On 1/27/2022 8:58 PM, Elijah Newren via GitGitGadget wrote:
> From: Elijah Newren <newren@gmail.com>
> 
> 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 <newren@gmail.com>
> ---
>     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(+)
> 
> diff --git a/builtin/sparse-checkout.c b/builtin/sparse-checkout.c
> index 679c1070368..c655517e019 100644
> --- a/builtin/sparse-checkout.c
> +++ b/builtin/sparse-checkout.c
> @@ -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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-28 15:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-28  1:58 [PATCH] sparse-checkout: fix a couple minor memory leaks Elijah Newren via GitGitGadget
2022-01-28 15:04 ` Derrick Stolee

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).