Re: [PATCH v5 03/15] bugreport: gather git version and build info
- From
Emily Shaffer <emilyshaffer@google.com>
- Date
- Feb 4, 2020, 22:21 UTC
- Message-ID
- <20200204222137.GD87163@google.com>
- In-Reply-To
- <CAN0heSqaeaBTCmiY=f0eD8=hsPV7BL9OCFL=Oq7je+t_o4frqA@mail.gmail.com>
On Thu, Jan 30, 2020 at 11:19:55PM +0100, Martin Ågren wrote:
Show 12 quoted lines
> On Fri, 24 Jan 2020 at 04:40, <emilyshaffer@google.com> wrote:
> > +static void get_system_info(struct strbuf *sys_info)
> > +{
> > + struct strbuf version_info = STRBUF_INIT;
> > +
> > + /* get git version from native cmd */
> > + strbuf_addstr(sys_info, "git version:\n");
> > + get_version_info(&version_info, 1);
> > + strbuf_addbuf(sys_info, &version_info);
> > + strbuf_complete_line(sys_info);
>
> This leaks version_info.So it does.
I think the easiest thing is to drop the 'strbuf_reset()' at the top of help.c:get_version_info(), and just pass in sys_info from bugreport.c.
- Emily