Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Philippe Waroquiers <philippe.waroquiers@skynet.be>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] Fix leak of set/show verbose doc, avoid xfree of static string
Date: Fri, 28 Dec 2018 17:21:00 -0000	[thread overview]
Message-ID: <1546017697.31031.21.camel@skynet.be> (raw)
In-Reply-To: <87lg49ob11.fsf@tromey.com>

On Fri, 2018-12-28 at 09:45 -0700, Tom Tromey wrote:
> > > > > > "Philippe" == Philippe Waroquiers <philippe.waroquiers@skynet.be> writes:
> 
> Philippe> gdb/ChangeLog
> Philippe> 2018-12-28  Philippe Waroquiers  <philippe.waroquiers@skynet.be>
> 
> Philippe> 	* top.c (set_verbose): Free previous docs if doc_allocated.
> Philippe> 	Internationalize messages.  Set doc_allocated to 0.
> 
> Thanks for the patch.  This is ok.
Thanks for the review, pushed.

> 
> Philippe> +  if (c->doc && c->doc_allocated)
> Philippe> +    xfree ((char *) c->doc);
> Philippe> +  if (showcmd->doc && showcmd->doc_allocated)
> Philippe> +    xfree ((char *) showcmd->doc);
> 
> Ideally I guess we'd have a better way of doing this.  A lot of the CLI
> machinery could use some cleanup, but for now this is still an "open"
> struct.
Effectively, as it is now, cmd_list_element memory management
is not very well encapsulated.

Philippe


      reply	other threads:[~2018-12-28 17:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-28 11:26 Philippe Waroquiers
2018-12-28 16:45 ` Tom Tromey
2018-12-28 17:21   ` Philippe Waroquiers [this message]

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=1546017697.31031.21.camel@skynet.be \
    --to=philippe.waroquiers@skynet.be \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /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