From: Stefan Beller <sbeller@google.com>
To: Jeff King <peff@peff.net>
Cc: Junio C Hamano <gitster@pobox.com>,
"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: [PATCH] test_bitmap_walk: free bitmap with bitmap_free
Date: Fri, 22 May 2015 09:37:27 -0700 [thread overview]
Message-ID: <CAGZ79kZqRE78qFGPcU9xiFDiGG3X0kaBFdH+rGhUCZBM3ikUDA@mail.gmail.com> (raw)
In-Reply-To: <20150522005336.GA26326@peff.net>
On Thu, May 21, 2015 at 5:53 PM, Jeff King <peff@peff.net> wrote:
> Commit f86a374 (pack-bitmap.c: fix a memleak, 2015-03-30)
> noticed that we leak the "result" bitmap. But we should use
> "bitmap_free" rather than straight "free", as the former
> remembers to free the bitmap array pointed to by the struct.
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> Sorry, I should have noticed this when reviewing the original.
No need to be sorry, me too.
This looks good to me.
>
> pack-bitmap.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/pack-bitmap.c b/pack-bitmap.c
> index 62a98cc..d64bd94 100644
> --- a/pack-bitmap.c
> +++ b/pack-bitmap.c
> @@ -987,7 +987,7 @@ void test_bitmap_walk(struct rev_info *revs)
> else
> fprintf(stderr, "Mismatch!\n");
>
> - free(result);
> + bitmap_free(result);
> }
>
> static int rebuild_bitmap(uint32_t *reposition,
> --
> 2.4.1.528.g00591e3
prev parent reply other threads:[~2015-05-22 16:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-22 0:53 [PATCH] test_bitmap_walk: free bitmap with bitmap_free Jeff King
2015-05-22 16:37 ` Stefan Beller [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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAGZ79kZqRE78qFGPcU9xiFDiGG3X0kaBFdH+rGhUCZBM3ikUDA@mail.gmail.com \
--to=sbeller@google.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
/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 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 NNTP newsgroup(s).