transport-helper: remove duplicate free()
PATCH 1/1 transport-helper: remove duplicate free()
Remove the free() invocation on transport->data in release_helper(), as disconnect_helper() has already done so.
---
Applies on top of 'next'.
transport-helper.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
transport-helper.c +0 -1
@@ -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
Quoted 2 lines · Tay Ray Chuan
Remove the
free()invocation ontransport->datainrelease_helper(), asdisconnect_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*
Quoted 9 lines · Daniel Barkalow
Quoted 2 lines · Tay Ray Chuan
Remove the
free()invocation ontransport->datainrelease_helper(), asdisconnect_helper()has already done so.You need to remove the one in
disconnect_helper, because the entire point ofdisconnect_helperas opposed torelease_helperis 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.
Hi,
Quoted 4 lines · Daniel Barkalow
You need to remove the one in
disconnect_helper, because the entire point ofdisconnect_helperas opposed torelease_helperis 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).
Signature · 2 lines
Cheers, Ray Chuan