Re: [PATCH 09/15] http: release the memory of a http pack request as well
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 22, 2015, 19:36 UTC
- Message-ID
- <xmqq1tkgddto.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <1426897692-18322-10-git-send-email-sbeller@google.com>
Stefan Beller <sbeller@google.com> writes:
Show 20 quoted lines
> The cleanup function is used in 4 places now and it's always safe to > free up the memory as well. > > Signed-off-by: Stefan Beller <sbeller@google.com> > --- > http.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/http.c b/http.c > index 9c825af..4b179f6 100644 > --- a/http.c > +++ b/http.c > @@ -1462,6 +1462,7 @@ void release_http_pack_request(struct http_pack_request *preq) > } > preq->slot = NULL; > free(preq->url); > + free(preq); > } > > int finish_http_pack_request(struct http_pack_request *preq)
Freeing of preq in all the callers of this one looks sensible, except for the one in finish_request() of http-push.c that pulls an preq instance out of request->userData.
Can somebody help me follow the dataflow to convince me that this is not leading to double-free in start_fetch_packed()?
Thanks.