{"thread":{"id":"21820","subject":"[PATCH] transport-helper: remove duplicate free()","startedAt":"2009-12-02T07:39:50Z","lastAt":"2009-12-02T23:00:08Z","messageCount":4,"participants":["Tay Ray Chuan","Daniel Barkalow","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"128980","messageId":"20091202153950.c18095b7.rctay89@gmail.com","threadId":"21820","inReplyTo":null,"subject":"[PATCH] transport-helper: remove duplicate free()","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2009-12-02T07:39:50Z","receivedAt":"2009-12-02T07:39:50Z","isPatch":true,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"Remove the free() invocation on transport->data in release_helper(), as\ndisconnect_helper() has already done so.\n\nSigned-off-by: Tay Ray Chuan <rctay89@gmail.com>\n---\n\n  Applies on top of 'next'.\n\n transport-helper.c |    1 -\n 1 files changed, 0 insertions(+), 1 deletions(-)\n\ndiff --git a/transport-helper.c b/transport-helper.c\nindex 9c5f860..2f77bd5 100644\n--- a/transport-helper.c\n+++ b/transport-helper.c\n@@ -196,7 +196,6 @@ static int release_helper(struct transport *transport)\n \tfree_refspec(data->refspec_nr, data->refspecs);\n \tdata->refspecs = NULL;\n \tdisconnect_helper(transport);\n-\tfree(transport->data);\n \treturn 0;\n }\n\n--\n1.6.6.rc0.306.g5bb1c0\n"},{"id":"129013","messageId":"alpine.LNX.2.00.0912021120440.14365@iabervon.org","threadId":"21820","inReplyTo":"20091202153950.c18095b7.rctay89@gmail.com","subject":"Re: [PATCH] transport-helper: remove duplicate free()","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2009-12-02T16:23:56Z","receivedAt":"2009-12-02T16:23:56Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Wed, 2 Dec 2009, Tay Ray Chuan wrote:\n\n> Remove the free() invocation on transport->data in release_helper(), as\n> disconnect_helper() has already done so.\n\nYou need to remove the one in disconnect_helper, because the entire point \nof disconnect_helper as opposed to release_helper is to *not* free that \nmemory. If you remove this one, you'll access freed memory in any case \nwhere the helper has to be quit and restarted.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"129040","messageId":"7vws15ci0s.fsf@alter.siamese.dyndns.org","threadId":"21820","inReplyTo":"alpine.LNX.2.00.0912021120440.14365@iabervon.org","subject":"Re: [PATCH] transport-helper: remove duplicate free()","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-12-02T19:06:43Z","receivedAt":"2009-12-02T19:06:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Daniel Barkalow <barkalow@iabervon.org> writes:\n\n> On Wed, 2 Dec 2009, Tay Ray Chuan wrote:\n>\n>> Remove the free() invocation on transport->data in release_helper(), as\n>> disconnect_helper() has already done so.\n>\n> You need to remove the one in disconnect_helper, because the entire point \n> of disconnect_helper as opposed to release_helper is to *not* free that \n> memory. If you remove this one, you'll access freed memory in any case \n> where the helper has to be quit and restarted.\n\nThanks.  I did two things:\n\n - Since the bottom commit cannot be rewritten (as it is based on the\n   version that is before the change in the caller to free it), I queued a\n   one liner to remove the free from the callee in 'next'.\n\n - The problem will surface when the series is later merged to 'master'.\n   I told my rerere database about the necessity of this \"evil merge\", so\n   that we will automatically have the equivalent of the one-liner when it\n   happens.\n"},{"id":"129083","messageId":"be6fef0d0912021500w313ac170m65251f7b8a4fa1de@mail.gmail.com","threadId":"21820","inReplyTo":"alpine.LNX.2.00.0912021120440.14365@iabervon.org","subject":"Re: [PATCH] transport-helper: remove duplicate free()","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2009-12-02T23:00:08Z","receivedAt":"2009-12-02T23:00:08Z","isPatch":true,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"Hi,\n\nOn Thu, Dec 3, 2009 at 12:23 AM, Daniel Barkalow <barkalow@iabervon.org> wrote:\n> You need to remove the one in disconnect_helper, because the entire point\n> of disconnect_helper as opposed to release_helper is to *not* free that\n> memory. If you remove this one, you'll access freed memory in any case\n> where the helper has to be quit and restarted.\n\nI see. I guess I should have looked more closely at f2a3715 (Fix\nmemory leak in helper method for disconnect).\n\n-- \nCheers,\nRay Chuan\n"}]}