git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Stefan Beller <sbeller@google.com>
Cc: gitster@pobox.com, git@vger.kernel.org, sunshine@sunshineco.com,
	tanoku@gmail.com, blees@dcon.de
Subject: Re: [PATCHv3 5/6] pack-bitmap.c: fix a memleak
Date: Mon, 30 Mar 2015 23:32:02 -0400	[thread overview]
Message-ID: <20150331033202.GB842@peff.net> (raw)
In-Reply-To: <1427764931-27745-6-git-send-email-sbeller@google.com>

On Mon, Mar 30, 2015 at 06:22:10PM -0700, Stefan Beller wrote:

> Signed-off-by: Stefan Beller <sbeller@google.com>
> ---
>  pack-bitmap.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/pack-bitmap.c b/pack-bitmap.c
> index 365f9d9..62a98cc 100644
> --- a/pack-bitmap.c
> +++ b/pack-bitmap.c
> @@ -986,6 +986,8 @@ void test_bitmap_walk(struct rev_info *revs)
>  		fprintf(stderr, "OK!\n");
>  	else
>  		fprintf(stderr, "Mismatch!\n");
> +
> +	free(result);

I think this one is fine. I see you dropped the other bits from
load_bitmap_entries_v1. There are definitely some leaks there in the
error case, and I left some notes in the other thread.

I don't think those leaks are all that critical (we only load the
bitmaps one per process, and the memory persists if we succeed, so the
worst case is that we spend the memory but do not get to use the
bitmaps). But if your goal is making us valgrind-clean, they would
certainly count.

-Peff

  reply	other threads:[~2015-03-31  3:32 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 [this message]
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
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

  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=20150331033202.GB842@peff.net \
    --to=peff@peff.net \
    --cc=blees@dcon.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=sbeller@google.com \
    --cc=sunshine@sunshineco.com \
    --cc=tanoku@gmail.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).