From: Junio C Hamano <gitster@pobox.com>
To: Tay Ray Chuan <rctay89@gmail.com>
Cc: Clemens Buchacher <drizzd@aon.at>,
git@vger.kernel.org,
Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: Re: [PATCH] http*: cleanup slot->local after fclose
Date: Sat, 30 May 2009 23:17:19 -0700 [thread overview]
Message-ID: <7vy6sdssnk.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20090531000955.953725d9.rctay89@gmail.com> (Tay Ray Chuan's message of "Sun\, 31 May 2009 00\:09\:55 +0800")
Tay Ray Chuan <rctay89@gmail.com> writes:
> Set slot->local to NULL after doing a fclose on the FILE* pointer it
> points to.
>
> Move NULL assignment to request->slot from
> http-push.c::finish_request() to http-push.c::release_request(). This
> is safe, since the functions finish_request() invoke will overwrite
> request->slot anyway.
>
> Refactor http-push.c::fetch_index(), http-walker.c::fetch_index() and
> http-walker.c::fetch_pack() to use labels while cleaning up.
>
> This fixes the issue raised by Clemens Buchacher on 30th May:
>
> http://www.spinics.net/lists/git/msg104623.html
>
> Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
> ---
>
> This applies on master, and is a resend, this time with the subject.
Shouldn't a fix instead be queued for 'maint', without "refactoring"?
Is there a reproducible repipe you can add to the test script?
> http-push.c | 23 ++++++++++++++---------
> http-walker.c | 36 +++++++++++++++++++++++-------------
> 2 files changed, 37 insertions(+), 22 deletions(-)
>
> diff --git a/http-push.c b/http-push.c
> index dac2c6e..816824a 100644
> --- a/http-push.c
> +++ b/http-push.c
> @@ -715,6 +715,8 @@ static void release_request(struct transfer_request *request)
> close(request->local_fileno);
> if (request->local_stream)
> fclose(request->local_stream);
> + if (request->slot)
> + request->slot = NULL;
> free(request->url);
> free(request);
Hmm, what's the point of setting NULL to request->slot if you are already
freeing "request" that contains the field?
next prev parent reply other threads:[~2009-05-31 6:17 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-24 16:35 [PATCH 3/3] http-push: send out fetch requests on queue Tay Ray Chuan
2009-05-30 9:17 ` Clemens Buchacher
2009-05-30 9:31 ` Tay Ray Chuan
2009-05-30 9:37 ` Clemens Buchacher
2009-05-30 10:52 ` Tay Ray Chuan
2009-05-30 15:01 ` Tay Ray Chuan
2009-05-30 16:09 ` [PATCH] http*: cleanup slot->local after fclose Tay Ray Chuan
2009-05-30 16:58 ` Clemens Buchacher
2009-05-31 6:17 ` Junio C Hamano [this message]
2009-05-31 8:48 ` Tay Ray Chuan
2009-05-31 9:54 ` [PATCH v2] " Tay Ray Chuan
2009-05-31 20:21 ` Junio C Hamano
2009-06-01 13:52 ` Tay Ray Chuan
2009-06-01 16:13 ` Junio C Hamano
2009-06-02 13:55 ` Tay Ray Chuan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vy6sdssnk.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=drizzd@aon.at \
--cc=git@vger.kernel.org \
--cc=rctay89@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).