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

Subsystems: the rest

STALE3738d

3 messages, 2 authors, 2016-06-15 · open the first message on its own page

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

From: Tay Ray Chuan <hidden>
Date: 2016-06-15 22:47:48

Remove the free() invocation on transport->data in release_helper(), as
disconnect_helper() has already done so.

Signed-off-by: Tay Ray Chuan <redacted>
---

  Applies on top of 'next'.

 transport-helper.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/transport-helper.c b/transport-helper.c
index 9c5f860..2f77bd5 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -196,7 +196,6 @@ static int release_helper(struct transport *transport)
 	free_refspec(data->refspec_nr, data->refspecs);
 	data->refspecs = NULL;
 	disconnect_helper(transport);
-	free(transport->data);
 	return 0;
 }

--
1.6.6.rc0.306.g5bb1c0

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

From: Daniel Barkalow <hidden>
Date: 2016-06-15 22:47:49

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.

	-Daniel
*This .sig left intentionally blank*

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

From: Tay Ray Chuan <hidden>
Date: 2016-06-15 22:47:49

Hi,

On Thu, Dec 3, 2009 at 12:23 AM, Daniel Barkalow [off-list ref] wrote:
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.
I see. I guess I should have looked more closely at f2a3715 (Fix
memory leak in helper method for disconnect).

-- 
Cheers,
Ray Chuan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help