git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] transport-helper: remove duplicate free()

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 2, 2009, 19:06 UTC
Message-ID
<7vws15ci0s.fsf@alter.siamese.dyndns.org>
In-Reply-To
<alpine.LNX.2.00.0912021120440.14365@iabervon.org>
Daniel Barkalow <barkalow@iabervon.org> writes:
Show 9 quoted lines
> 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.
Previous: Daniel BarkalowNext: Tay Ray Chuan
Message 3 of 4 in “transport-helper: remove duplicate free()”
  1. transport-helper: remove duplicate free()Tay Ray Chuan, Dec 2, 2009
  2. Daniel BarkalowDec 2, 2009
  3. Junio C HamanoDec 2, 2009
  4. Tay Ray ChuanDec 2, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.