This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Fix leak of set/show verbose doc, avoid xfree of static string
- From: Tom Tromey <tom at tromey dot com>
- To: Philippe Waroquiers <philippe dot waroquiers at skynet dot be>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 28 Dec 2018 09:45:30 -0700
- Subject: Re: [RFA] Fix leak of set/show verbose doc, avoid xfree of static string
- References: <20181228112644.28560-1-philippe.waroquiers@skynet.be>
>>>>> "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.
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.
Tom