git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Derrick Stolee <stolee@gmail.com>
To: Elijah Newren via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org
Cc: Victoria Dye <vdye@github.com>,
	Lessley Dennington <lessleydennington@gmail.com>,
	Elijah Newren <newren@gmail.com>
Subject: Re: [PATCH] sparse-checkout: fix a couple minor memory leaks
Date: Fri, 28 Jan 2022 10:04:43 -0500	[thread overview]
Message-ID: <2bea96f1-48dd-884f-244c-479d635487f1@gmail.com> (raw)
In-Reply-To: <pull.1189.git.git.1643335098710.gitgitgadget@gmail.com>

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


      reply	other threads:[~2022-01-28 15:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2bea96f1-48dd-884f-244c-479d635487f1@gmail.com \
    --to=stolee@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=lessleydennington@gmail.com \
    --cc=newren@gmail.com \
    --cc=vdye@github.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).