Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sparse-checkout: fix a couple minor memory leaks #1189

Closed
wants to merge 1 commit into from

Conversation

newren
Copy link
Contributor

@newren newren commented Jan 13, 2022

cc: Derrick Stolee stolee@gmail.com
cc: Victoria Dye vdye@github.com
cc: Lessley Dennington lessleydennington@gmail.com

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 <newren@gmail.com>
@newren
Copy link
Contributor Author

newren commented Jan 28, 2022

/submit

@gitgitgadget-git
Copy link

Submitted as pull.1189.git.git.1643335098710.gitgitgadget@gmail.com

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git/ pr-git-1189/newren/sparse-directory-cleaning-memleaks-v1

To fetch this version to local tag pr-git-1189/newren/sparse-directory-cleaning-memleaks-v1:

git fetch --no-tags https://github.com/gitgitgadget/git/ tag pr-git-1189/newren/sparse-directory-cleaning-memleaks-v1

@gitgitgadget-git
Copy link

On the Git mailing list, Derrick Stolee wrote (reply to this):

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

@gitgitgadget-git
Copy link

This branch is now known as en/sparse-checkout-leakfix.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via df77982.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via 5b44536.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via 2211153.

@gitgitgadget-git
Copy link

There was a status update in the "New Topics" section about the branch en/sparse-checkout-leakfix on the Git mailing list:

Leakfix.

Will merge to 'next'.
source: <pull.1189.git.git.1643335098710.gitgitgadget@gmail.com>

@gitgitgadget-git
Copy link

This patch series was integrated into seen via af15ca1.

@gitgitgadget-git
Copy link

This patch series was integrated into next via 10ca176.

@gitgitgadget-git gitgitgadget-git bot added the next label Feb 4, 2022
@gitgitgadget-git
Copy link

This patch series was integrated into seen via a11d629.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via 54d1ed2.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via bafd2d7.

@gitgitgadget-git
Copy link

There was a status update in the "Cooking" section about the branch en/sparse-checkout-leakfix on the Git mailing list:

Leakfix.

Will merge to 'master'.
source: <pull.1189.git.git.1643335098710.gitgitgadget@gmail.com>

@gitgitgadget-git
Copy link

This patch series was integrated into seen via 18eaabb.

@gitgitgadget-git
Copy link

This patch series was integrated into seen via 9210a00.

@gitgitgadget-git
Copy link

This patch series was integrated into next via 9210a00.

@gitgitgadget-git
Copy link

This patch series was integrated into master via 9210a00.

@gitgitgadget-git
Copy link

Closed via 9210a00.

@newren newren deleted the sparse-directory-cleaning-memleaks branch February 17, 2022 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant