public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org, Harald Nordgren <haraldnordgren@gmail.com>
Subject: Re: [PATCH 4/4] remote: always allocate branch.push_tracking_ref
Date: Mon, 19 Jan 2026 07:34:13 +0100	[thread overview]
Message-ID: <aW3QZaYoPQvBkfvd@pks.im> (raw)
In-Reply-To: <20260119052320.GD1991523@coredump.intra.peff.net>

On Mon, Jan 19, 2026 at 12:23:20AM -0500, Jeff King wrote:
> diff --git a/remote.c b/remote.c
> index e191b0ff6e..3e9d9b3e1f 100644
> --- a/remote.c
> +++ b/remote.c
> @@ -1924,7 +1925,7 @@ static const char *branch_get_push_1(struct repository *repo,
>  		return tracking_for_push_dest(remote, branch->refname, err);
>  
>  	case PUSH_DEFAULT_UPSTREAM:
> -		return branch_get_upstream(branch, err);
> +		return xstrdup_or_null(branch_get_upstream(branch, err));
>  
>  	case PUSH_DEFAULT_UNSPECIFIED:
>  	case PUSH_DEFAULT_SIMPLE:

Makes sense. I was wondering whether you'd also change
`branch_get_push_1()` in a subsequent patch, so I'm happy to see this.

This whole series looks good to me, thanks!

Patrick

  reply	other threads:[~2026-01-19  6:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-19  5:18 [PATCH 0/4] memory leaks in remote.c Jeff King
2026-01-19  5:19 ` [PATCH 1/4] remote: return non-const pointer from error_buf() Jeff King
2026-01-19  6:33   ` Patrick Steinhardt
2026-01-20  0:28     ` Junio C Hamano
2026-01-20 19:38       ` Jeff King
2026-01-20 20:18         ` Junio C Hamano
2026-01-19  5:20 ` [PATCH 2/4] remote: drop const return of tracking_for_push_dest() Jeff King
2026-01-19  6:34   ` Patrick Steinhardt
2026-01-19  5:22 ` [PATCH 3/4] remote: fix leak in branch_get_push_1() with invalid "simple" config Jeff King
2026-01-19  6:34   ` Patrick Steinhardt
2026-01-19  5:23 ` [PATCH 4/4] remote: always allocate branch.push_tracking_ref Jeff King
2026-01-19  6:34   ` Patrick Steinhardt [this message]
2026-01-19 15:04 ` Triangular workflow Harald Nordgren
2026-01-20 19:40   ` Jeff King
2026-01-20  0:31 ` [PATCH 0/4] memory leaks in remote.c Junio C Hamano

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=aW3QZaYoPQvBkfvd@pks.im \
    --to=ps@pks.im \
    --cc=git@vger.kernel.org \
    --cc=haraldnordgren@gmail.com \
    --cc=peff@peff.net \
    /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