git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Rubén Justo" <rjusto@gmail.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [PATCH 0/4] fix a leak with excludes_file
Date: Mon, 08 Apr 2024 10:36:30 -0700	[thread overview]
Message-ID: <xmqqy19nbvtt.fsf@gitster.g> (raw)
In-Reply-To: <1323321b-554e-4b16-a814-03710c50db99@gmail.com> ("Rubén Justo"'s message of "Sun, 7 Apr 2024 19:48:48 +0200")

Rubén Justo <rjusto@gmail.com> writes:

> It does not have to be like that.  We may no longer need the current
> and problematic git_config_pathname().  However I did not want to go
> that far in this series.

True, but that one and only true interface we will end up with MUST
NOT be strbuf based one, and that is why I said the patch as posted
will not take us into a better future.

And as a stop-gap measure, ...

>> -	if (!strcmp(var, "core.excludesfile"))
>> +	if (!strcmp(var, "core.excludesfile")) {
>> +		free((char *)excludes_file);
>
> Aaah, you prefer this :-( ...  this free is what I was referring to, in
> the message you are replying to, as the simpler fix ...

... obviously this would be much more preferrable.  And when the one
and only true interface comes, we only need to drop the cast from
around here.

Thanks.


  reply	other threads:[~2024-04-08 17:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-06 14:29 [PATCH 0/4] fix a leak with excludes_file Rubén Justo
2024-04-06 14:31 ` [PATCH 1/4] path.c: introduce strbuf_interpolate_path Rubén Justo
2024-04-06 14:32 ` [PATCH 2/4] config.c: introduce git_config_strbuf_pathname Rubén Justo
2024-04-06 14:32 ` [PATCH 3/4] environment.c: convert excludes_file to struct strbuf Rubén Justo
2024-04-06 14:32 ` [PATCH 4/4] t7300: mark as leak-free Rubén Justo
2024-04-06 17:53 ` [PATCH 0/4] fix a leak with excludes_file Junio C Hamano
2024-04-07 17:48   ` Rubén Justo
2024-04-08 17:36     ` Junio C Hamano [this message]
2024-04-08 19:33       ` Rubén Justo

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqy19nbvtt.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=rjusto@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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).