Re: [PATCH 15/20] remote: fix leaking config strings

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

 



On Wed, Aug 21, 2024 at 10:58:55AM -0700, Junio C Hamano wrote:
> Patrick Steinhardt <ps@xxxxxx> writes:
> 
> > @@ -2802,6 +2809,7 @@ void remote_state_clear(struct remote_state *remote_state)
> >  	for (i = 0; i < remote_state->remotes_nr; i++)
> >  		remote_clear(remote_state->remotes[i]);
> >  	FREE_AND_NULL(remote_state->remotes);
> > +	FREE_AND_NULL(remote_state->pushremote_name);
> >  	remote_state->remotes_alloc = 0;
> >  	remote_state->remotes_nr = 0;
> 
> As remote_state has two extra structures embedded in it, I wonder if
> we should be clearing them in this function, but possibly it is
> cleared elsewhere or perhaps in a later series?

It is not yet part of any subsequent patch series, mostly because I
didn't happen to stumble over such leaks yet. Both of the rewrites very
much are leaky though, and would be hit when we use "insteadOf" or
"pushInsteadOf" configs.

The `struct branch` also needs handling and is being populated via
"branch" configs.

> As the focus of this step is about strings that we obtained from the
> config API, it is totally outside the scope of this topic, even if
> it turns out to be needed to clear them.

Well, these are being populated via config strings. So I'd rather fix
them in this commit, as well.

Patrick




[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