From: Junio C Hamano Date: Thu, 05 Nov 2026 22:28:52 GMT Subject: Re: [PATCH v2 05/12] send-pack: plug leak upon match_push_refs failure Message-ID: In-Reply-To: <20261014031347.50433-6-jon@jonsimons.org> Jon Simons writes: > Otherwise memory leak tests will flag the missing finish_connect(). > > Signed-off-by: Jon Simons > --- > builtin/send-pack.c | 3 +++ > 1 file changed, 3 insertions(+) Looks trivially correct. > > diff --git a/builtin/send-pack.c b/builtin/send-pack.c > index d6cdbae472..4e6a45ba30 100644 > --- a/builtin/send-pack.c > +++ b/builtin/send-pack.c > @@ -311,6 +311,9 @@ int cmd_send_pack(int argc, > /* match them up */ > if (match_push_refs(local_refs, &remote_refs, &rs, flags)) { > ret = -1; > + close(fd[1]); > + close(fd[0]); > + finish_connect(conn); > goto cleanup; > } > if (!is_empty_cas(&cas))