All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Keeping <john@keeping.me.uk>
To: Stefan Beller <sbeller@google.com>
Cc: gitster@pobox.com, git@vger.kernel.org, sunshine@sunshineco.com
Subject: Re: [PATCHv3 6/6] entry.c: fix a memleak
Date: Tue, 31 Mar 2015 09:36:47 +0100	[thread overview]
Message-ID: <20150331083647.GA2248@serenity.lan> (raw)
In-Reply-To: <1427764931-27745-7-git-send-email-sbeller@google.com>

On Mon, Mar 30, 2015 at 06:22:11PM -0700, Stefan Beller wrote:
> From: John Keeping <john@keeping.me.uk>
> 
> stream_blob_to_fd() always frees the filter now, so there is no memory
> leak in entry.c:152 just before the `goto finish`.
> 
> Signed-off-by: John Keeping <john@keeping.me.uk>
> Signed-off-by: Stefan Beller <sbeller@google.com>
> ---
>  
>  I added Johns signoff here tentatively, John can you confirm the sign off?

Signed-off-by: John Keeping <john@keeping.me.uk>

>  streaming.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/streaming.c b/streaming.c
> index 2ff036a..811fcc2 100644
> --- a/streaming.c
> +++ b/streaming.c
> @@ -507,8 +507,11 @@ int stream_blob_to_fd(int fd, unsigned const char *sha1, struct stream_filter *f
>  	int result = -1;
>  
>  	st = open_istream(sha1, &type, &sz, filter);
> -	if (!st)
> +	if (!st) {
> +		if (filter)
> +			free_stream_filter(filter);
>  		return result;
> +	}
>  	if (type != OBJ_BLOB)
>  		goto close_and_exit;
>  	for (;;) {
> -- 
> 2.3.0.81.gc37f363
> 

  parent reply	other threads:[~2015-03-31  8:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-31  1:22 [PATCHv3 0/6] Memory leaks once again Stefan Beller
2015-03-31  1:22 ` [PATCHv3 1/6] shallow: fix a memleak Stefan Beller
2015-03-31  2:52   ` Eric Sunshine
2015-03-31  1:22 ` [PATCHv3 2/6] line-log.c: " Stefan Beller
2015-03-31  1:22 ` [PATCHv3 3/6] " Stefan Beller
2015-03-31  4:42   ` Torsten Bögershausen
2015-03-31  5:06   ` Junio C Hamano
2015-03-31  5:35     ` Stefan Beller
2015-03-31 19:03       ` Junio C Hamano
2015-03-31  1:22 ` [PATCHv3 4/6] wt-status.c: " Stefan Beller
2015-03-31  1:22 ` [PATCHv3 5/6] pack-bitmap.c: " Stefan Beller
2015-03-31  3:32   ` Jeff King
2015-03-31  1:22 ` [PATCHv3 6/6] entry.c: " Stefan Beller
2015-03-31  5:41   ` Junio C Hamano
2015-03-31  8:36   ` John Keeping [this message]
2015-03-31 19:12     ` Junio C Hamano

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

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

  git send-email \
    --in-reply-to=20150331083647.GA2248@serenity.lan \
    --to=john@keeping.me.uk \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=sbeller@google.com \
    --cc=sunshine@sunshineco.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.