From: Junio C Hamano <gitster@pobox.com>
To: Daniel Barkalow <barkalow@iabervon.org>
Cc: Tay Ray Chuan <rctay89@gmail.com>,
git@vger.kernel.org, Sverre Rabbelier <srabbelier@gmail.com>,
Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] transport-helper: remove duplicate free()
Date: Wed, 02 Dec 2009 11:06:43 -0800 [thread overview]
Message-ID: <7vws15ci0s.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <alpine.LNX.2.00.0912021120440.14365@iabervon.org> (Daniel Barkalow's message of "Wed\, 2 Dec 2009 11\:23\:56 -0500 \(EST\)")
Daniel Barkalow <barkalow@iabervon.org> writes:
> On Wed, 2 Dec 2009, Tay Ray Chuan wrote:
>
>> Remove the free() invocation on transport->data in release_helper(), as
>> disconnect_helper() has already done so.
>
> You need to remove the one in disconnect_helper, because the entire point
> of disconnect_helper as opposed to release_helper is to *not* free that
> memory. If you remove this one, you'll access freed memory in any case
> where the helper has to be quit and restarted.
Thanks. I did two things:
- Since the bottom commit cannot be rewritten (as it is based on the
version that is before the change in the caller to free it), I queued a
one liner to remove the free from the callee in 'next'.
- The problem will surface when the series is later merged to 'master'.
I told my rerere database about the necessity of this "evil merge", so
that we will automatically have the equivalent of the one-liner when it
happens.
next prev parent reply other threads:[~2009-12-02 19:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-02 7:39 [PATCH] transport-helper: remove duplicate free() Tay Ray Chuan
2009-12-02 16:23 ` Daniel Barkalow
2009-12-02 19:06 ` Junio C Hamano [this message]
2009-12-02 23:00 ` Tay Ray Chuan
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=7vws15ci0s.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=barkalow@iabervon.org \
--cc=git@vger.kernel.org \
--cc=rctay89@gmail.com \
--cc=srabbelier@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.
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).