Re: [PATCH] rebase: use child_process_clear() to clean

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 22, 2024 at 10:21:23AM -0700, Junio C Hamano wrote:

> > We should use child_process_clear() instead, which covers both. And more
> > importantly, it future proofs us against the struct ever growing more
> > allocated fields.
> 
> When 21853626 (built-in rebase: call `git am` directly, 2019-01-18)
> started using run_command() API to drive "am", there already was
> child_process API and child_process_clear() did clear both .args and
> .env_array members but we used argv_array_clear() only to clear
> am.args, leaking am.env_array.

Ah, interesting. I didn't bother to dig into the history. Back then,
though, I think that "args" was the only allocated thing. The env call
was added much later in be0d29d301 (rebase --apply: make reflog messages
match rebase --merge, 2022-10-12).

> I wonder what are in .env array at this point, though, but that is
> mere curiosity and not a problem with this patch.

It's $GIT_REFLOG_ACTION for the sub-process.

-Peff




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux